修正
This commit is contained in:
@@ -4,10 +4,20 @@ async function apiGet(path, params = {}) {
|
||||
const query = new URLSearchParams(params).toString();
|
||||
const url = `${API_BASE}${path}?${query}`;
|
||||
|
||||
console.log(`📡 API GET: ${url}`);
|
||||
|
||||
const res = await fetch(url);
|
||||
|
||||
console.log(`📊 Response status: ${res.status}`);
|
||||
|
||||
if (!res.ok) {
|
||||
const data = await res.json();
|
||||
console.error(`❌ API Error:`, data);
|
||||
throw new Error(data.detail || "APIエラー");
|
||||
}
|
||||
return res.json();
|
||||
|
||||
const jsonData = await res.json();
|
||||
console.log(`✅ API Response:`, jsonData);
|
||||
|
||||
return jsonData;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user