mirror of
https://github.com/samsonjs/immich.git
synced 2026-04-27 15:07:45 +00:00
fix(server): remove isWatched from DTO (#8598)
* fix: remove isWatched * chore: open api
This commit is contained in:
parent
20583d5334
commit
7b1562c050
9 changed files with 3 additions and 19 deletions
BIN
mobile/openapi/doc/CreateLibraryDto.md
generated
BIN
mobile/openapi/doc/CreateLibraryDto.md
generated
Binary file not shown.
BIN
mobile/openapi/lib/model/create_library_dto.dart
generated
BIN
mobile/openapi/lib/model/create_library_dto.dart
generated
Binary file not shown.
BIN
mobile/openapi/test/create_library_dto_test.dart
generated
BIN
mobile/openapi/test/create_library_dto_test.dart
generated
Binary file not shown.
|
|
@ -8000,9 +8000,6 @@
|
||||||
"isVisible": {
|
"isVisible": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"isWatched": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -461,7 +461,6 @@ export type CreateLibraryDto = {
|
||||||
exclusionPatterns?: string[];
|
exclusionPatterns?: string[];
|
||||||
importPaths?: string[];
|
importPaths?: string[];
|
||||||
isVisible?: boolean;
|
isVisible?: boolean;
|
||||||
isWatched?: boolean;
|
|
||||||
name?: string;
|
name?: string;
|
||||||
ownerId: string;
|
ownerId: string;
|
||||||
"type": LibraryType;
|
"type": LibraryType;
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,6 @@ export class CreateLibraryDto {
|
||||||
@ArrayUnique()
|
@ArrayUnique()
|
||||||
@ArrayMaxSize(128)
|
@ArrayMaxSize(128)
|
||||||
exclusionPatterns?: string[];
|
exclusionPatterns?: string[];
|
||||||
|
|
||||||
@ValidateBoolean({ optional: true })
|
|
||||||
isWatched?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class UpdateLibraryDto {
|
export class UpdateLibraryDto {
|
||||||
|
|
|
||||||
|
|
@ -1058,14 +1058,6 @@ describe(LibraryService.name, () => {
|
||||||
|
|
||||||
expect(libraryMock.create).not.toHaveBeenCalled();
|
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();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -266,9 +266,6 @@ export class LibraryService extends EventEmitter {
|
||||||
if (dto.exclusionPatterns && dto.exclusionPatterns.length > 0) {
|
if (dto.exclusionPatterns && dto.exclusionPatterns.length > 0) {
|
||||||
throw new BadRequestException('Upload libraries cannot have exclusion patterns');
|
throw new BadRequestException('Upload libraries cannot have exclusion patterns');
|
||||||
}
|
}
|
||||||
if (dto.isWatched) {
|
|
||||||
throw new BadRequestException('Upload libraries cannot be watched');
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,9 @@
|
||||||
|
|
||||||
const handleCreate = async (ownerId: string) => {
|
const handleCreate = async (ownerId: string) => {
|
||||||
try {
|
try {
|
||||||
const createdLibrary = await createLibrary({ createLibraryDto: { ownerId, type: LibraryType.External } });
|
const createdLibrary = await createLibrary({
|
||||||
|
createLibraryDto: { ownerId, type: LibraryType.External },
|
||||||
|
});
|
||||||
|
|
||||||
notificationController.show({
|
notificationController.show({
|
||||||
message: `Created library: ${createdLibrary.name}`,
|
message: `Created library: ${createdLibrary.name}`,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue