mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
feat: wip UI upload attachments
This commit is contained in:
19
packages/webapp/src/containers/Attachments/utils.ts
Normal file
19
packages/webapp/src/containers/Attachments/utils.ts
Normal 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 }));
|
||||
};
|
||||
Reference in New Issue
Block a user