This commit is contained in:
truewhile
2026-08-26 17:05:41 +08:00
parent 1d53bf2ae1
commit 2888ae8bf7
6 changed files with 130 additions and 20 deletions
+3
View File
@@ -102,6 +102,9 @@ export const libraryAPI = {
createWithRoots: (name: string, type: string, roots: LibraryRootInput[], coverURL = '') =>
api.post<Library>('/libraries', { name, type, roots, cover_url: coverURL }).then((r) => r.data),
createPerSubfolder: (parentPath: string, type: string, coverURL = '') =>
api.post<{ libraries: Library[] }>('/libraries', { path: parentPath, type, cover_url: coverURL, create_per_subfolder: true }).then((r) => r.data),
update: (id: string, payload: { cover_url: string }) =>
api.patch<Library>(`/libraries/${id}`, payload).then((r) => r.data),