Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR fixes
Browse files Browse the repository at this point in the history
cs-raj committed Apr 23, 2024
1 parent 194de88 commit e9e9455
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ module.exports = async ({ migration, stackSDKInstance, managementAPIClient, conf
const res = await stackSDKInstance.contentType(ct).entry().query({ include_count: true, skip, limit }).find();
count = res.count;
skip += limit;
entries = [...entries, ...res.items];
entries.push(...res.items);
}
return entries;
} catch (err) {
@@ -58,8 +58,9 @@ module.exports = async ({ migration, stackSDKInstance, managementAPIClient, conf

const replaceEntriesWithUpdatedUids = (matches, uidMapping, stringifiedEntry) => {
let isUpdated = false;
let oldUids = Object.keys(uidMapping);
matches.forEach((m) => {
if (Object.keys(uidMapping).includes(m)) {
if (oldUids.includes(m)) {
let regex = new RegExp(m, 'g');
stringifiedEntry = stringifiedEntry.replace(regex, uidMapping[m]);
console.log(chalk.green(`Replacing UID '${m}' with '${uidMapping[m]}'`));

0 comments on commit e9e9455

Please sign in to comment.