- svelte.config.js: paths.relative=false so CSS uses absolute /_app/ paths (fixes blank home page after redirect)
- ai-jobs: fix openReview() mutating stale alias r instead of $state review — was causing 'Loading results...' to never resolve for chapter-names/image-gen/description
- notifications bell: redesign with All/Unread tabs, per-item dismiss (×), mark-all-read, clear-all, 'View all' footer link
- /admin/notifications: new dedicated full-page notifications view
- api/notifications proxy: add PATCH (mark-all-read) and DELETE (clear-all, dismiss) handlers
- runner: add CreateNotification calls on success/failure in runScrapeTask, runAudioTask, runTranslationTask
- storage/import.go: real PDF (dslipak/pdf) and EPUB (archive/zip + x/net/html) parsing replacing stubs
- translation admin page: stream jobs Promise instead of blocking navigation
- store.go: DeleteNotification, ClearAllNotifications, MarkAllNotificationsRead methods
- handlers_notifications.go + server.go: PATCH /api/notifications, DELETE /api/notifications, DELETE /api/notifications/{id}
21 lines
781 B
TypeScript
21 lines
781 B
TypeScript
import { json, error } from '@sveltejs/kit';
|
|
import type { RequestHandler } from './$types';
|
|
import { backendFetch } from '$lib/server/scraper';
|
|
|
|
export const PATCH: RequestHandler = async ({ params }) => {
|
|
const id = params.id;
|
|
if (!id) throw error(400, 'id required');
|
|
const res = await backendFetch('/api/notifications/' + id, { method: 'PATCH' });
|
|
const data = await res.json().catch(() => ({}));
|
|
return json(data);
|
|
};
|
|
|
|
// DELETE /api/notifications/[id] — dismiss a single notification
|
|
export const DELETE: RequestHandler = async ({ params }) => {
|
|
const id = params.id;
|
|
if (!id) throw error(400, 'id required');
|
|
const res = await backendFetch('/api/notifications/' + id, { method: 'DELETE' });
|
|
const data = await res.json().catch(() => ({}));
|
|
return json(data);
|
|
};
|