Devlog-Löschung: Discord-Delete-Sync + Admin-Button im Webinterface
- MessageDelete-Listener (mit Partials): in Discord gelöschte Devlogs verschwinden automatisch aus dem Archiv, inkl. lokaler Bilder - DELETE /api/devlogs/:id (nur Admin) + ✕-Button auf den Karten (nur für Admin sichtbar) - Anlass: Test-Post mit Commit-Liste von vor der Prosa-Sperre stand noch im Archiv Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+5
-2
@@ -1,6 +1,6 @@
|
||||
// Kleiner Fetch-Wrapper — Cookies (Session) laufen automatisch mit (same-origin)
|
||||
export async function apiGet(path) {
|
||||
const res = await fetch(path, { headers: { Accept: 'application/json' } });
|
||||
async function api(path, options = {}) {
|
||||
const res = await fetch(path, { headers: { Accept: 'application/json' }, ...options });
|
||||
if (!res.ok) {
|
||||
const error = new Error(`API ${res.status}`);
|
||||
error.status = res.status;
|
||||
@@ -8,3 +8,6 @@ export async function apiGet(path) {
|
||||
}
|
||||
return res.json();
|
||||
}
|
||||
|
||||
export const apiGet = (path) => api(path);
|
||||
export const apiDelete = (path) => api(path, { method: 'DELETE' });
|
||||
|
||||
Reference in New Issue
Block a user