fix: add requested changes

This commit is contained in:
Emnaghz 2025-02-20 14:08:44 +01:00
parent 82f46ad65e
commit e0865ea3e5
2 changed files with 8 additions and 10 deletions

View File

@ -256,8 +256,8 @@ describe('ContentController', () => {
image: 'image.jpg', image: 'image.jpg',
}, },
id: '', id: '',
createdAt: null as unknown as Date, createdAt: new Date(),
updatedAt: null as unknown as Date, updatedAt: new Date(),
}, },
]); ]);
@ -267,7 +267,7 @@ describe('ContentController', () => {
mockContentType.id, mockContentType.id,
mockContentType, mockContentType,
); );
expect(result).toEqual([ expect(result).toEqualPayload([
{ {
entity: mockContentType.id, entity: mockContentType.id,
title: 'store 3', title: 'store 3',
@ -276,8 +276,6 @@ describe('ContentController', () => {
image: 'image.jpg', image: 'image.jpg',
}, },
id: '', id: '',
createdAt: null as unknown as Date,
updatedAt: null as unknown as Date,
}, },
]); ]);
}); });

View File

@ -100,7 +100,7 @@ export const Contents = () => {
const { data: contentType } = useGet(String(query.id), { const { data: contentType } = useGet(String(query.id), {
entity: EntityType.CONTENT_TYPE, entity: EntityType.CONTENT_TYPE,
}); });
const { mutateAsync: importDataset, isLoading } = useImport( const { mutate: importDataset, isLoading } = useImport(
EntityType.CONTENT, EntityType.CONTENT,
{ {
onError: () => { onError: () => {
@ -125,11 +125,11 @@ export const Contents = () => {
}, },
{ idTargetContentType: contentType?.id } { idTargetContentType: contentType?.id }
); );
const handleImportChange = async (file: File) => { const handleImportChange = (file: File) => {
await importDataset(file); importDataset(file);
}; };
return ( return (
<Grid container flexDirection="column" gap={3}> <Grid container flexDirection="column" gap={3}>
<Grid item height="fit-content" container> <Grid item height="fit-content" container>
<Link href="/content/types"> <Link href="/content/types">