File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed
projects/app/src/pages/api/admin Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -108,18 +108,21 @@ async function appSplitMigration(teamId: string) {
108108 const obj = appMap . get ( folder . _id ) ! ;
109109 const newParentId = obj ?. parentId ? appMap . get ( obj ! . parentId ) ?. newId : null ;
110110
111- const oldRps = RPMap . get ( folder . _id ) ! ;
112- rpOps . push (
113- ...oldRps . map ( ( oldRp ) => ( {
114- insertOne : {
115- document : {
116- ...oldRp ,
117- resourceId : obj . newId ! ,
118- _id : undefined
111+ const oldRps = RPMap . get ( folder . _id ) ;
112+
113+ if ( oldRps ) {
114+ rpOps . push (
115+ ...oldRps . map ( ( oldRp ) => ( {
116+ insertOne : {
117+ document : {
118+ ...oldRp ,
119+ resourceId : obj . newId ! ,
120+ _id : undefined
121+ }
119122 }
120- }
121- } ) )
122- ) ;
123+ } ) )
124+ ) ;
125+ }
123126
124127 if ( ! newParentId ) {
125128 continue ;
You can’t perform that action at this time.
0 commit comments