mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
20 lines
459 B
TypeScript
20 lines
459 B
TypeScript
// @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 }));
|
|
};
|