Skip to content

Commit

Permalink
Merge pull request #1006 from InseeFr/fix/sims
Browse files Browse the repository at this point in the history
fix: solve issue with sms
  • Loading branch information
PierreVasseur authored Oct 7, 2024
2 parents 0414842 + 37634a3 commit 41f098d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,19 @@ const SimsCreation = ({
e.stopPropagation();
setSaving(true);

const idParent = idParent || idParentProp;
const idParentToSave = idParent || idParentProp;

const rubrics = Object.values(sims).map(convertRubric);

const sims = {
const simsToSave = {
id: mode !== DUPLICATE ? simsProp.id : '',
labelLg1: mode !== DUPLICATE ? simsProp.labelLg1 : '',
labelLg2: mode !== DUPLICATE ? simsProp.labelLg2 : '',
[getParentIdName(parentType)]: idParent,
[getParentIdName(parentType)]: idParentToSave,
created: mode !== DUPLICATE ? simsProp.created : '',
rubrics,
};
onSubmit(sims, (id) => {
onSubmit(simsToSave, (id) => {
setSaving(false);
goBack(`/operations/sims/${id}`);
});
Expand Down

0 comments on commit 41f098d

Please sign in to comment.