1
0
mirror of https://github.com/immich-app/immich.git synced 2025-01-12 15:32:36 +02:00

fix(server): remove isWatched from DTO (#8598)

* fix: remove isWatched

* chore: open api
This commit is contained in:
Daniel Dietzler 2024-04-08 22:00:08 +02:00 committed by GitHub
parent 20583d5334
commit 7b1562c050
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 3 additions and 19 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -8000,9 +8000,6 @@
"isVisible": {
"type": "boolean"
},
"isWatched": {
"type": "boolean"
},
"name": {
"type": "string"
},

View File

@ -461,7 +461,6 @@ export type CreateLibraryDto = {
exclusionPatterns?: string[];
importPaths?: string[];
isVisible?: boolean;
isWatched?: boolean;
name?: string;
ownerId: string;
"type": LibraryType;

View File

@ -32,9 +32,6 @@ export class CreateLibraryDto {
@ArrayUnique()
@ArrayMaxSize(128)
exclusionPatterns?: string[];
@ValidateBoolean({ optional: true })
isWatched?: boolean;
}
export class UpdateLibraryDto {

View File

@ -1058,14 +1058,6 @@ describe(LibraryService.name, () => {
expect(libraryMock.create).not.toHaveBeenCalled();
});
it('should not create watched', async () => {
await expect(
sut.create({ ownerId: authStub.admin.user.id, type: LibraryType.UPLOAD, isWatched: true }),
).rejects.toBeInstanceOf(BadRequestException);
expect(storageMock.watch).not.toHaveBeenCalled();
});
});
});

View File

@ -266,9 +266,6 @@ export class LibraryService extends EventEmitter {
if (dto.exclusionPatterns && dto.exclusionPatterns.length > 0) {
throw new BadRequestException('Upload libraries cannot have exclusion patterns');
}
if (dto.isWatched) {
throw new BadRequestException('Upload libraries cannot be watched');
}
break;
}
}

View File

@ -118,7 +118,9 @@
const handleCreate = async (ownerId: string) => {
try {
const createdLibrary = await createLibrary({ createLibraryDto: { ownerId, type: LibraryType.External } });
const createdLibrary = await createLibrary({
createLibraryDto: { ownerId, type: LibraryType.External },
});
notificationController.show({
message: `Created library: ${createdLibrary.name}`,