Skip to content

Commit

Permalink
fix: change the data format to file creationDate and publishDate from…
Browse files Browse the repository at this point in the history
… Date to string
  • Loading branch information
ChengShi-1 committed Dec 4, 2024
1 parent f21affc commit 756569c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/files/domain/models/FileModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export interface FileModel {
checksum?: FileChecksum
metadataId?: number
tabularTags?: string[]
creationDate?: Date
publicationDate?: Date
creationDate?: string
publicationDate?: string
deleted: boolean
tabularData: boolean
fileAccessRequest?: boolean
Expand Down
4 changes: 2 additions & 2 deletions src/files/infra/repositories/transformers/fileTransformers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ const transformFilePayloadToFile = (filePayload: FilePayload): FileModel => {
...(filePayload.dataFile.fileMetadataId && { metadataId: filePayload.dataFile.fileMetadataId }),
...(filePayload.dataFile.tabularTags && { tabularTags: filePayload.dataFile.tabularTags }),
...(filePayload.dataFile.creationDate && {
creationDate: new Date(filePayload.dataFile.creationDate)
creationDate: filePayload.dataFile.creationDate
}),
...(filePayload.dataFile.publicationDate && {
publicationDate: new Date(filePayload.dataFile.publicationDate)
publicationDate: filePayload.dataFile.publicationDate
}),
deleted: filePayload.dataFile.deleted,
tabularData: filePayload.dataFile.tabularData,
Expand Down
4 changes: 2 additions & 2 deletions test/testHelpers/files/filesHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const createFileModel = (): FileModel => {
previousDataFileId: 4,
md5: '29e413e0c881e17314ce8116fed4d1a7',
metadataId: 4,
creationDate: new Date('2023-07-11'),
creationDate: '2023-07-11',
embargo: {
dateAvailable: new Date('2023-07-11'),
reason: 'test'
Expand All @@ -59,7 +59,7 @@ export const createFileModel = (): FileModel => {
originalSize: 127426,
originalName: 'originalName',
tabularTags: ['tag1', 'tag2'],
publicationDate: new Date('2023-07-11')
publicationDate: '2023-07-11'
}
}

Expand Down

0 comments on commit 756569c

Please sign in to comment.