feat(assets): add searchable media library and verified orphan cleanup

This commit is contained in:
eezd committed 2026-10-22 15:09:15 +08:00
1 parent 06be0038cf
commit 91a359c2b7
13 files changed
+424 -51

No files matched your search

+6
View File
@@ -188,6 +188,12 @@ export const api = {
return (await json<{ link: string }>(request('POST', '/api/v1/assets?note=' + encodeURIComponent(note), { body: form }))).link
},
cleanupImages: (paths: string[]) => json<{ deleted: TrashItem[]; skipped: { path: string; reason: string }[] }>(request('POST', '/api/v1/assets/cleanup', { json: { paths } })),
uploadFolderImage: async (folder: string, file: File) => {
const body = new FormData()
body.append('file', file)
return json<{ link: string }>(request('POST', '/api/v1/assets?folder=' + encodeURIComponent(folder), { body }))
},
replaceImage: (path: string, file: File) => {
const body = new FormData()
body.append('file', file)