Changed design language. Added editions, better support for authors. Base for file handling

This commit is contained in:
2026-03-28 15:17:20 +02:00
parent cbd7f52535
commit 5acde17a53
84 changed files with 5861 additions and 1983 deletions
+25
View File
@@ -0,0 +1,25 @@
import type { BookFile } from '../types'
export function fetchBookFiles(bookId: number): Promise<BookFile[]> {
return fetch(`/api/books/${bookId}/files`).then(r => r.json())
}
export function fetchUnmatchedFiles(): Promise<BookFile[]> {
return fetch('/api/files?unmatched=true').then(r => r.json())
}
export function assignFile(id: number, bookId: number | null, editionId: number | null): Promise<BookFile> {
return fetch(`/api/files/${id}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ bookId, editionId }),
}).then(r => r.json())
}
export function deleteFile(id: number): Promise<void> {
return fetch(`/api/files/${id}`, { method: 'DELETE' }).then(() => undefined)
}
export function triggerScan(): Promise<void> {
return fetch('/api/scan', { method: 'POST' }).then(() => undefined)
}