mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor(server): library service (#8050)
* refactor: library service * chore: open api * fix: checks
This commit is contained in:
parent
761e7fdd2d
commit
40262c30cb
21 changed files with 198 additions and 335 deletions
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
const dispatch = createEventDispatcher<{
|
||||
cancel: void;
|
||||
submit: { ownerId: string | null };
|
||||
submit: { ownerId: string };
|
||||
delete: void;
|
||||
}>();
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
removeOfflineFiles,
|
||||
scanLibrary,
|
||||
updateLibrary,
|
||||
type CreateLibraryDto,
|
||||
type LibraryResponseDto,
|
||||
type LibraryStatsResponseDto,
|
||||
type UserResponseDto,
|
||||
|
|
@ -117,14 +116,9 @@
|
|||
}
|
||||
}
|
||||
|
||||
const handleCreate = async (ownerId: string | null) => {
|
||||
const handleCreate = async (ownerId: string) => {
|
||||
try {
|
||||
let createLibraryDto: CreateLibraryDto = { type: LibraryType.External };
|
||||
if (ownerId) {
|
||||
createLibraryDto = { ...createLibraryDto, ownerId };
|
||||
}
|
||||
|
||||
const createdLibrary = await createLibrary({ createLibraryDto });
|
||||
const createdLibrary = await createLibrary({ createLibraryDto: { ownerId, type: LibraryType.External } });
|
||||
|
||||
notificationController.show({
|
||||
message: `Created library: ${createdLibrary.name}`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue