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

@@ -32,6 +32,7 @@ import {
defaultManualJournal,
} from './utils';
import { JournalSyncIncrementSettingsToForm } from './components';
import { transformAttachmentsToRequest } from '@/containers/Attachments/utils';
/**
* Journal entries form.
@@ -61,7 +62,6 @@ function MakeJournalEntriesForm({
journalNumberPrefix,
journalNextNumber,
);
// Form initial values.
const initialValues = useMemo(
() => ({
@@ -112,6 +112,7 @@ function MakeJournalEntriesForm({
setSubmitting(false);
return;
}
const attachments = transformAttachmentsToRequest(values);
const form = {
...omit(values, ['journal_number_manually']),
...(values.journal_number_manually && {
@@ -119,6 +120,7 @@ function MakeJournalEntriesForm({
}),
entries: R.compose(orderingLinesIndexes)(entries),
publish: submitPayload.publish,
attachments,
};
// Handle the request error.
const handleError = ({