fix(create-action): invalid save mode

This commit is contained in:
chenos 2024-03-06 23:05:16 +08:00
parent 2e3dd1250c
commit 0f1115b058

View File

@ -10,7 +10,6 @@ import { useNavigate } from 'react-router-dom';
import { useReactToPrint } from 'react-to-print'; import { useReactToPrint } from 'react-to-print';
import { import {
AssociationFilter, AssociationFilter,
useCollectionManager,
useCollectionRecord, useCollectionRecord,
useDataSourceHeaders, useDataSourceHeaders,
useFormActiveFields, useFormActiveFields,
@ -194,7 +193,7 @@ export const useCreateActionProps = () => {
const { t } = useTranslation(); const { t } = useTranslation();
const { updateAssociationValues } = useFormBlockContext(); const { updateAssociationValues } = useFormBlockContext();
const collectValues = useCollectValuesToSubmit(); const collectValues = useCollectValuesToSubmit();
const action = record.isNew ? 'create' : 'update'; const action = record.isNew ? actionField.componentProps.saveMode || 'create' : 'update';
const filterKeys = actionField.componentProps.filterKeys?.checked || []; const filterKeys = actionField.componentProps.filterKeys?.checked || [];
return { return {
async onClick() { async onClick() {