File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed
manager-dashboard/app/views/NewTutorial Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments