From 720868ebf02127272239260fbae1dba6354da04f Mon Sep 17 00:00:00 2001 From: adueck Date: Tue, 26 Nov 2024 14:18:29 +0500 Subject: [PATCH] try --- functions/src/submissions.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/functions/src/submissions.ts b/functions/src/submissions.ts index cc7b87c..35a68a0 100644 --- a/functions/src/submissions.ts +++ b/functions/src/submissions.ts @@ -1,11 +1,11 @@ import Nano from "nano"; import * as FT from "../../website/src/types/functions-types"; import * as functions from "firebase-functions"; -import { - addDictionaryEntries, - deleteEntry, - updateDictionaryEntries, -} from "./tools/spreadsheet-tools"; +// import { +// addDictionaryEntries, +// deleteEntry, +// updateDictionaryEntries, +// } from "./tools/spreadsheet-tools"; const nano = Nano(functions.config().couchdb.couchdb_url); const reviewTasksDb = nano.db.use("review-tasks"); @@ -31,12 +31,14 @@ export async function receiveSubmissions( await reviewTasksDb.bulk({ docs }); } - const { newEntries, entryEdits, entryDeletions } = sortEdits(edits); - await updateDictionaryEntries(entryEdits); - for (const ed of entryDeletions) { - await deleteEntry(ed); + if (edits.length && editor) { + // const { newEntries, entryEdits, entryDeletions } = sortEdits(edits); + // await updateDictionaryEntries(entryEdits); + // for (const ed of entryDeletions) { + // await deleteEntry(ed); + // } + // await addDictionaryEntries(newEntries); } - await addDictionaryEntries(newEntries); return { ok: true,