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": { "isVisible": {
"type": "boolean" "type": "boolean"
}, },
"isWatched": {
"type": "boolean"
},
"name": { "name": {
"type": "string" "type": "string"
}, },

View file

@ -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;

View file

@ -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 {

View file

@ -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();
});
}); });
}); });

View file

@ -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;
} }
} }

View file

@ -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}`,