From 24fa8cef78a6b9a3ef344c6ae34b235cd90c1aa3 Mon Sep 17 00:00:00 2001 From: Stanislas Polu Date: Mon, 22 Jan 2024 10:05:21 +0100 Subject: [PATCH] connectors: cli remove skipReason for page and databases (#3352) --- connectors/src/admin/cli.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/connectors/src/admin/cli.ts b/connectors/src/admin/cli.ts index f659378a2342..f8922d4ae277 100644 --- a/connectors/src/admin/cli.ts +++ b/connectors/src/admin/cli.ts @@ -335,6 +335,18 @@ const notion = async (command: string, args: parseArgs.ParsedArgs) => { }, }); + if (args.remove) { + if (existingPage) { + console.log(`Removing skipped page reason for ${pageId}`); + await existingPage.update({ + skipReason: null, + }); + } else { + console.log(`Page ${pageId} is not skipped, nothing to remove`); + } + return; + } + const skipReason = args.reason || "blacklisted"; if (existingPage) { @@ -387,6 +399,20 @@ const notion = async (command: string, args: parseArgs.ParsedArgs) => { }, }); + if (args.remove) { + if (existingDatabase) { + console.log(`Removing skipped database reason for ${databaseId}`); + await existingDatabase.update({ + skipReason: null, + }); + } else { + console.log( + `Database ${databaseId} is not skipped, nothing to remove` + ); + } + return; + } + if (existingDatabase) { if (args.reason) { console.log(