feat(server): make is favorite optional on asset upload (#4865)

* feat(server): make isFavorite optional

* chore: open api

* chore: e2e
This commit is contained in:
Jason Rasmussen
2023-11-06 09:04:39 -05:00
committed by GitHub
parent 9e7a32804b
commit 279481ad54
10 changed files with 61 additions and 58 deletions
+2 -4
View File
@@ -6655,8 +6655,7 @@
"deviceAssetId",
"deviceId",
"fileCreatedAt",
"fileModifiedAt",
"isFavorite"
"fileModifiedAt"
],
"type": "object"
},
@@ -7143,8 +7142,7 @@
"deviceAssetId",
"deviceId",
"fileCreatedAt",
"fileModifiedAt",
"isFavorite"
"fileModifiedAt"
],
"type": "object"
},
@@ -22,9 +22,10 @@ export class CreateAssetBase {
@Type(() => Date)
fileModifiedAt!: Date;
@Optional()
@IsBoolean()
@Transform(toBoolean)
isFavorite!: boolean;
isFavorite?: boolean;
@Optional()
@IsBoolean()
-1
View File
@@ -146,7 +146,6 @@ describe(`${AssetController.name} (e2e)`, () => {
{ should: 'require `deviceId`', dto: { ...makeUploadDto({ omit: 'deviceId' }) } },
{ should: 'require `fileCreatedAt`', dto: { ...makeUploadDto({ omit: 'fileCreatedAt' }) } },
{ should: 'require `fileModifiedAt`', dto: { ...makeUploadDto({ omit: 'fileModifiedAt' }) } },
{ should: 'require `isFavorite`', dto: { ...makeUploadDto({ omit: 'isFavorite' }) } },
{ should: 'require `duration`', dto: { ...makeUploadDto({ omit: 'duration' }) } },
{ should: 'throw if `isFavorite` is not a boolean', dto: { ...makeUploadDto(), isFavorite: 'not-a-boolean' } },
{ should: 'throw if `isVisible` is not a boolean', dto: { ...makeUploadDto(), isVisible: 'not-a-boolean' } },