From 70d98c7cd5db85e361a49f04e31b8a08fa9de160 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Tue, 13 Jun 2023 09:02:17 +0100 Subject: [PATCH] chore: remove generateSearch script --- .../submitProject/src/_generateSearch.js | 35 ------------------- 1 file changed, 35 deletions(-) delete mode 100644 functions/submitProject/src/_generateSearch.js diff --git a/functions/submitProject/src/_generateSearch.js b/functions/submitProject/src/_generateSearch.js deleted file mode 100644 index 02e8a09..0000000 --- a/functions/submitProject/src/_generateSearch.js +++ /dev/null @@ -1,35 +0,0 @@ -const sdk = require("node-appwrite"); - -const client = new sdk.Client(); - -client - .setEndpoint("https://cloud.appwrite.io/v1") - .setProject("builtWithAppwrite") - .setKey("---"); - -const databases = new sdk.Databases(client); - -async function generateSearch() { - // Get all projects - const { documents: projects } = await databases.listDocuments( - "main", - "projects" - ); - - for (const project of projects) { - const { $id, useCase, uiLibrary, framework, name, tagline } = project; - - // Build combined string for full-text search index - const search = `${name} ${tagline} ${framework} ${uiLibrary} ${useCase}`; - - // Update project with search string - - await databases.updateDocument("main", "projects", $id, { - search, - }); - - console.log(`Updated project ${name}`); - } -} - -generateSearch();