ImagesTable: Ensure created_at date for a new image

This adds a temporary value of current date to `created_at` for newly created images.

This is not the most elegant solution and will be reworked after the ImagesTable refactor.
This commit is contained in:
regexowl 2023-05-04 14:32:15 +02:00 committed by Lucas Garfield
parent f1f544daec
commit 83206171f9

View file

@ -573,6 +573,10 @@ const CreateImageWizard = () => {
const appendTo = useMemo(() => document.querySelector(MODAL_ANCHOR), []);
// In case the `created_at` date is undefined when creating an image
// a temporary value with current date is added
const currentDate = new Date();
return (
<ImageCreator
onClose={handleClose}
@ -587,6 +591,7 @@ const CreateImageWizard = () => {
compose: {
...response,
request,
created_at: currentDate.toISOString(),
image_status: { status: 'pending' },
},
insert: true,