mirror of
https://github.com/immich-app/immich.git
synced 2025-12-18 09:13:15 +03:00
refactor(server): library service (#8050)
* refactor: library service * chore: open api * fix: checks
This commit is contained in:
@@ -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}`,
|
||||
|
||||
Reference in New Issue
Block a user