fix: Feed POST 失敗時は GET にフォールバック

Made-with: Cursor
This commit is contained in:
posimai 2026-04-11 13:58:20 +09:00
parent dcb0274de7
commit 7d8297a243
1 changed files with 13 additions and 6 deletions

View File

@ -990,12 +990,19 @@ async function loadFeed() {
}));
}
} catch (_) { /* カスタムソース取得失敗 → デフォルトのみで続行 */ }
res = await fetch(FEED_API, {
method: 'POST',
cache: 'no-store',
headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${apiKey}` },
body: JSON.stringify({ customFeeds }),
});
try {
res = await fetch(FEED_API, {
method: 'POST',
cache: 'no-store',
headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${apiKey}` },
body: JSON.stringify({ customFeeds }),
});
} catch (_) {
res = await fetch(FEED_API, { cache: 'no-store' });
}
if (res.status === 401) {
res = await fetch(FEED_API, { cache: 'no-store' });
}
} else {
res = await fetch(FEED_API, { cache: 'no-store' });
}