Skip to content

Commit

Permalink
add to updateParents
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Fontanier committed Dec 12, 2024
1 parent 50289f7 commit 024c436
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions connectors/src/connectors/notion/lib/parents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,18 @@ export async function updateAllParentsFields(
for (const pageId of pageIdsToUpdate) {
promises.push(
q.add(async () => {
const parents = await getParents(
const pageOrDbIds = await getParents(
connectorId,
pageId,
[],
memoizationKey,
onProgress
);

// TODO(kw_search) remove legacy
const legacyParents = pageOrDbIds;
const parents = pageOrDbIds.map((id) => `notion-${id}`);

logger.info(
{
connectorId,
Expand All @@ -172,7 +177,7 @@ export async function updateAllParentsFields(
await updateDocumentParentsField({
dataSourceConfig: dataSourceConfigFromConnector(connector),
documentId: `notion-${pageId}`,
parents,
parents: [...parents, ...legacyParents],
});
if (onProgress) {
await onProgress();
Expand Down

0 comments on commit 024c436

Please sign in to comment.