fix: initv4141 script (#5967)

This commit is contained in:
Finley Ge 2025-11-21 10:23:24 +08:00 committed by GitHub
parent fa163a5456
commit c2e53a0179
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -108,18 +108,21 @@ async function appSplitMigration(teamId: string) {
const obj = appMap.get(folder._id)!;
const newParentId = obj?.parentId ? appMap.get(obj!.parentId)?.newId : null;
const oldRps = RPMap.get(folder._id)!;
rpOps.push(
...oldRps.map((oldRp) => ({
insertOne: {
document: {
...oldRp,
resourceId: obj.newId!,
_id: undefined
const oldRps = RPMap.get(folder._id);
if (oldRps) {
rpOps.push(
...oldRps.map((oldRp) => ({
insertOne: {
document: {
...oldRp,
resourceId: obj.newId!,
_id: undefined
}
}
}
}))
);
}))
);
}
if (!newParentId) {
continue;