docker composed
This commit is contained in:
+7
-3
@@ -1,8 +1,12 @@
|
||||
// Базовый URL API. Если фронт и бэк на одном домене, можно использовать '' или '/api'
|
||||
const API_BASE = 'http://localhost:8000';
|
||||
// frontend/js/api.js
|
||||
import { apiFetch } from "./auth.js";
|
||||
import { API_BASE } from "./config.js"; // <-- Добавили импорт
|
||||
|
||||
// УДАЛИТЬ эти строки из начала api.js:
|
||||
// export const API_BASE = ...
|
||||
|
||||
export async function fetchWorkoutTypes() {
|
||||
const res = await fetch(`${API_BASE}/workout-types/`);
|
||||
const res = await apiFetch("/workout-types/");
|
||||
if (!res.ok) throw new Error('Failed to fetch workout types');
|
||||
return await res.json();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user