mirror of
https://github.com/immich-app/immich.git
synced 2025-03-04 02:11:44 -05: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 4 additions and 43 deletions
1
mobile/openapi/doc/CreateLibraryDto.md
generated
1
mobile/openapi/doc/CreateLibraryDto.md
generated
|
@ -11,7 +11,6 @@ Name | Type | Description | Notes
|
|||
**exclusionPatterns** | **List<String>** | | [optional] [default to const []]
|
||||
**importPaths** | **List<String>** | | [optional] [default to const []]
|
||||
**isVisible** | **bool** | | [optional]
|
||||
**isWatched** | **bool** | | [optional]
|
||||
**name** | **String** | | [optional]
|
||||
**ownerId** | **String** | |
|
||||
**type** | [**LibraryType**](LibraryType.md) | |
|
||||
|
|
19
mobile/openapi/lib/model/create_library_dto.dart
generated
19
mobile/openapi/lib/model/create_library_dto.dart
generated
|
@ -16,7 +16,6 @@ class CreateLibraryDto {
|
|||
this.exclusionPatterns = const [],
|
||||
this.importPaths = const [],
|
||||
this.isVisible,
|
||||
this.isWatched,
|
||||
this.name,
|
||||
required this.ownerId,
|
||||
required this.type,
|
||||
|
@ -34,14 +33,6 @@ class CreateLibraryDto {
|
|||
///
|
||||
bool? isVisible;
|
||||
|
||||
///
|
||||
/// Please note: This property should have been non-nullable! Since the specification file
|
||||
/// does not include a default value (using the "default:" property), however, the generated
|
||||
/// source code must fall back to having a nullable type.
|
||||
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||
///
|
||||
bool? isWatched;
|
||||
|
||||
///
|
||||
/// Please note: This property should have been non-nullable! Since the specification file
|
||||
/// does not include a default value (using the "default:" property), however, the generated
|
||||
|
@ -59,7 +50,6 @@ class CreateLibraryDto {
|
|||
_deepEquality.equals(other.exclusionPatterns, exclusionPatterns) &&
|
||||
_deepEquality.equals(other.importPaths, importPaths) &&
|
||||
other.isVisible == isVisible &&
|
||||
other.isWatched == isWatched &&
|
||||
other.name == name &&
|
||||
other.ownerId == ownerId &&
|
||||
other.type == type;
|
||||
|
@ -70,13 +60,12 @@ class CreateLibraryDto {
|
|||
(exclusionPatterns.hashCode) +
|
||||
(importPaths.hashCode) +
|
||||
(isVisible == null ? 0 : isVisible!.hashCode) +
|
||||
(isWatched == null ? 0 : isWatched!.hashCode) +
|
||||
(name == null ? 0 : name!.hashCode) +
|
||||
(ownerId.hashCode) +
|
||||
(type.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'CreateLibraryDto[exclusionPatterns=$exclusionPatterns, importPaths=$importPaths, isVisible=$isVisible, isWatched=$isWatched, name=$name, ownerId=$ownerId, type=$type]';
|
||||
String toString() => 'CreateLibraryDto[exclusionPatterns=$exclusionPatterns, importPaths=$importPaths, isVisible=$isVisible, name=$name, ownerId=$ownerId, type=$type]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
|
@ -87,11 +76,6 @@ class CreateLibraryDto {
|
|||
} else {
|
||||
// json[r'isVisible'] = null;
|
||||
}
|
||||
if (this.isWatched != null) {
|
||||
json[r'isWatched'] = this.isWatched;
|
||||
} else {
|
||||
// json[r'isWatched'] = null;
|
||||
}
|
||||
if (this.name != null) {
|
||||
json[r'name'] = this.name;
|
||||
} else {
|
||||
|
@ -117,7 +101,6 @@ class CreateLibraryDto {
|
|||
? (json[r'importPaths'] as Iterable).cast<String>().toList(growable: false)
|
||||
: const [],
|
||||
isVisible: mapValueOfType<bool>(json, r'isVisible'),
|
||||
isWatched: mapValueOfType<bool>(json, r'isWatched'),
|
||||
name: mapValueOfType<String>(json, r'name'),
|
||||
ownerId: mapValueOfType<String>(json, r'ownerId')!,
|
||||
type: LibraryType.fromJson(json[r'type'])!,
|
||||
|
|
5
mobile/openapi/test/create_library_dto_test.dart
generated
5
mobile/openapi/test/create_library_dto_test.dart
generated
|
@ -31,11 +31,6 @@ void main() {
|
|||
// TODO
|
||||
});
|
||||
|
||||
// bool isWatched
|
||||
test('to test the property `isWatched`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// String name
|
||||
test('to test the property `name`', () async {
|
||||
// TODO
|
||||
|
|
|
@ -8000,9 +8000,6 @@
|
|||
"isVisible": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"isWatched": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
|
|
|
@ -461,7 +461,6 @@ export type CreateLibraryDto = {
|
|||
exclusionPatterns?: string[];
|
||||
importPaths?: string[];
|
||||
isVisible?: boolean;
|
||||
isWatched?: boolean;
|
||||
name?: string;
|
||||
ownerId: string;
|
||||
"type": LibraryType;
|
||||
|
|
|
@ -32,9 +32,6 @@ export class CreateLibraryDto {
|
|||
@ArrayUnique()
|
||||
@ArrayMaxSize(128)
|
||||
exclusionPatterns?: string[];
|
||||
|
||||
@ValidateBoolean({ optional: true })
|
||||
isWatched?: boolean;
|
||||
}
|
||||
|
||||
export class UpdateLibraryDto {
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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}`,
|
||||
|
|
Loading…
Add table
Reference in a new issue