feat: wip UI upload attachments

This commit is contained in:
Ahmed Bouhuolia
2024-05-28 23:34:51 +02:00
parent fcd61c6159
commit cfdbcea9c0
49 changed files with 286 additions and 67 deletions

View File

@@ -0,0 +1,19 @@
// @ts-nocheck
import { transformToForm } from '@/utils';
const attachmentReqSchema = {
key: '',
size: '',
origin_name: '',
mime_type: '',
};
export const transformAttachmentsToForm = (values) => {
return values.attachments?.map((attachment) =>
transformToForm(attachment, attachmentReqSchema),
);
};
export const transformAttachmentsToRequest = (values) => {
return values.attachments?.map((attachment) => ({ key: attachment.key }));
};