File tree Expand file tree Collapse file tree 2 files changed +2
-13
lines changed Expand file tree Collapse file tree 2 files changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -246,15 +246,7 @@ describe('/shared-links', () => {
246
246
const { status, body } = await request ( app ) . get ( '/shared-links/me' ) . query ( { key : linkWithMetadata . key } ) ;
247
247
248
248
expect ( status ) . toBe ( 200 ) ;
249
- expect ( body . assets ) . toHaveLength ( 1 ) ;
250
- expect ( body . assets [ 0 ] ) . toEqual (
251
- expect . objectContaining ( {
252
- originalFileName : 'example.png' ,
253
- localDateTime : expect . any ( String ) ,
254
- fileCreatedAt : expect . any ( String ) ,
255
- exifInfo : expect . any ( Object ) ,
256
- } ) ,
257
- ) ;
249
+ expect ( body . assets ) . toHaveLength ( 0 ) ;
258
250
expect ( body . album ) . toBeDefined ( ) ;
259
251
} ) ;
260
252
Original file line number Diff line number Diff line change @@ -104,9 +104,6 @@ export class SharedLinkResponseDto {
104
104
105
105
export function mapSharedLink ( sharedLink : SharedLinkEntity ) : SharedLinkResponseDto {
106
106
const linkAssets = sharedLink . assets || [ ] ;
107
- const albumAssets = ( sharedLink ?. album ?. assets || [ ] ) . map ( ( asset ) => asset ) ;
108
-
109
- const assets = _ . uniqBy ( [ ...linkAssets , ...albumAssets ] , ( asset ) => asset . id ) ;
110
107
111
108
return {
112
109
id : sharedLink . id ,
@@ -117,7 +114,7 @@ export function mapSharedLink(sharedLink: SharedLinkEntity): SharedLinkResponseD
117
114
type : sharedLink . type ,
118
115
createdAt : sharedLink . createdAt ,
119
116
expiresAt : sharedLink . expiresAt ,
120
- assets : assets . map ( ( asset ) => mapAsset ( asset ) ) ,
117
+ assets : linkAssets . map ( ( asset ) => mapAsset ( asset ) ) ,
121
118
album : sharedLink . album ? mapAlbumWithoutAssets ( sharedLink . album ) : undefined ,
122
119
allowUpload : sharedLink . allowUpload ,
123
120
allowDownload : sharedLink . allowDownload ,
You can’t perform that action at this time.
0 commit comments