remove unneccessary arrayUnion flag

This commit is contained in:
Han Tuerker
2022-11-15 08:35:25 +03:00
parent b8dab674f7
commit bdfce19af0

View File

@@ -23,8 +23,7 @@ import {
sideDrawerShowHiddenFieldsAtom,
} from "@src/atoms/tableScope";
import { formatSubTableName } from "@src/utils/table";
import { ColumnConfig, TableRow } from "@src/types/table";
import { FieldType } from "@src/components/fields/types";
import { TableRow } from "@src/types/table";
export interface ISideDrawerFieldsProps {
row: TableRow;
@@ -67,17 +66,7 @@ export default function SideDrawerFields({ row }: ISideDrawerFieldsProps) {
setSaveState("saving");
try {
const { type } = tableColumnsOrdered.find(
(c) => c.key === selectedCell.columnKey
) as ColumnConfig;
const useArrayUnion = [FieldType.file, FieldType.image].includes(type);
await updateField({
path: selectedCell!.path,
fieldName,
value,
useArrayUnion,
});
await updateField({ path: selectedCell!.path, fieldName, value });
setSaveState("saved");
} catch (e) {
enqueueSnackbar((e as Error).message, { variant: "error" });