Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change file creation date and publication date in FileModel from date object to string type #226

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading