Skip to content

Commit ac3b9b1

Browse files
shreeyash07frozenhelium
authored andcommitted
fix create tutorial issue
1 parent fb36470 commit ac3b9b1

File tree

1 file changed

+13
-11
lines changed
  • manager-dashboard/app/views/NewTutorial

1 file changed

+13
-11
lines changed

manager-dashboard/app/views/NewTutorial/index.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -254,19 +254,21 @@ function NewTutorial(props: Props) {
254254
});
255255
const sanitizedInformationPages = await Promise.all(informationPagesPromises);
256256

257+
const sanitizedCustomOptions = valuesToCopy.customOptions?.map((option) => {
258+
const optionWithoutId = deleteKey(option, 'optionId');
259+
return {
260+
...optionWithoutId,
261+
subOptions: optionWithoutId.subOptions?.map(
262+
(subOption) => deleteKey(subOption, 'subOptionsId'),
263+
),
264+
};
265+
});
266+
257267
const uploadData = {
258268
...valuesToCopy,
259-
customOptions: valuesToCopy.customOptions?.map((option) => {
260-
const optionWithoutId = deleteKey(option, 'optionId');
261-
return {
262-
...optionWithoutId,
263-
subOptions: optionWithoutId.subOptions?.map(
264-
(subOption) => deleteKey(subOption, 'subOptionsId'),
265-
),
266-
};
267-
}),
268-
screens: sanitizedScenarioPages,
269-
informationPages: sanitizedInformationPages,
269+
customOptions: sanitizedCustomOptions ?? null,
270+
screens: sanitizedScenarioPages ?? null,
271+
informationPages: sanitizedInformationPages ?? null,
270272
createdBy: userId,
271273
};
272274

0 commit comments

Comments
 (0)