try
This commit is contained in:
parent
f128ee52f0
commit
720868ebf0
|
@ -1,11 +1,11 @@
|
||||||
import Nano from "nano";
|
import Nano from "nano";
|
||||||
import * as FT from "../../website/src/types/functions-types";
|
import * as FT from "../../website/src/types/functions-types";
|
||||||
import * as functions from "firebase-functions";
|
import * as functions from "firebase-functions";
|
||||||
import {
|
// import {
|
||||||
addDictionaryEntries,
|
// addDictionaryEntries,
|
||||||
deleteEntry,
|
// deleteEntry,
|
||||||
updateDictionaryEntries,
|
// updateDictionaryEntries,
|
||||||
} from "./tools/spreadsheet-tools";
|
// } from "./tools/spreadsheet-tools";
|
||||||
|
|
||||||
const nano = Nano(functions.config().couchdb.couchdb_url);
|
const nano = Nano(functions.config().couchdb.couchdb_url);
|
||||||
const reviewTasksDb = nano.db.use("review-tasks");
|
const reviewTasksDb = nano.db.use("review-tasks");
|
||||||
|
@ -31,12 +31,14 @@ export async function receiveSubmissions(
|
||||||
await reviewTasksDb.bulk({ docs });
|
await reviewTasksDb.bulk({ docs });
|
||||||
}
|
}
|
||||||
|
|
||||||
const { newEntries, entryEdits, entryDeletions } = sortEdits(edits);
|
if (edits.length && editor) {
|
||||||
await updateDictionaryEntries(entryEdits);
|
// const { newEntries, entryEdits, entryDeletions } = sortEdits(edits);
|
||||||
for (const ed of entryDeletions) {
|
// await updateDictionaryEntries(entryEdits);
|
||||||
await deleteEntry(ed);
|
// for (const ed of entryDeletions) {
|
||||||
|
// await deleteEntry(ed);
|
||||||
|
// }
|
||||||
|
// await addDictionaryEntries(newEntries);
|
||||||
}
|
}
|
||||||
await addDictionaryEntries(newEntries);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
ok: true,
|
ok: true,
|
||||||
|
|
Loading…
Reference in New Issue