Skip to content

Commit

Permalink
LPS-200511 Consistently store saved ID as a number
Browse files Browse the repository at this point in the history
  • Loading branch information
markocikos authored and brianchandotcom committed Nov 15, 2023
1 parent 4c69d3e commit 3a9bd92
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ interface ISaveFDSFieldsModalContentProps {
fdsFields: Array<IFDSField>;
fdsView: FDSViewType;
namespace: string;
onSave: Function;
onSave: ({
createdFDSFields,
deletedFDSFieldsIds,
}: {
createdFDSFields: Array<IFDSField>;
deletedFDSFieldsIds: Array<number>;
}) => void;
saveFDSFieldsURL: string;
}

Expand Down Expand Up @@ -158,15 +164,15 @@ const SaveFDSFieldsModalContent = ({
setSaveButtonDisabled(true);

const creationData: Array<{name: string; type: string}> = [];
const deletionIds: Array<string> = [];
const deletionIds: Array<number> = [];

fields?.forEach((field) => {
if (field.selected && !field.id) {
creationData.push({name: field.name, type: field.type});
}

if (!field.selected && field.id) {
deletionIds.push(field.id);
deletionIds.push(Number(field.id));
}
});

Expand Down

0 comments on commit 3a9bd92

Please sign in to comment.