Skip to content

Commit 13604cc

Browse files
Merge #128
128: Update build files r=bidoubiwa a=bidoubiwa Files of the latest PR #74 were not added in the lib files. Meaning that the changer are not applied on the npm package Co-authored-by: Charlotte Vermandel <[email protected]>
2 parents d27d3bc + 77b8f7f commit 13604cc

File tree

2 files changed

+4511
-4553
lines changed

2 files changed

+4511
-4553
lines changed

functions/lib/index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ async function handleAddDocument(documentId, snapshot) {
5757
logs.addDocument(documentId);
5858
if ((0, validate_1.validateDocumentId)(documentId)) {
5959
const document = (0, adapter_1.adaptDocument)(documentId, snapshot);
60-
await index.addDocuments([document], { primaryKey: '_firestore_id' });
60+
const { taskUid } = await index.addDocuments([document], {
61+
primaryKey: '_firestore_id',
62+
});
63+
firebase_functions_1.logger.info(`Document addition request for document with ID ${documentId} added to task list (task ID ${taskUid}).`);
6164
}
6265
else {
6366
firebase_functions_1.logger.error(`Could not create document with id: ${documentId}. The document id can only contain case-insensitive alphanumeric characters (abcDEF), hyphens (-) or underscores(_).`);
@@ -75,7 +78,8 @@ async function handleDeleteDocument(documentId) {
7578
try {
7679
logs.deleteDocument(documentId);
7780
if ((0, validate_1.validateDocumentId)(documentId)) {
78-
await index.deleteDocument(documentId);
81+
const { taskUid } = await index.deleteDocument(documentId);
82+
firebase_functions_1.logger.info(`Document deletion request for document with ID ${documentId} added to task list (task ID ${taskUid}).`);
7983
}
8084
else {
8185
firebase_functions_1.logger.error(`Could not delete document with id: ${documentId}. The document id can only contain case-insensitive alphanumeric characters (abcDEF), hyphens (-) or underscores(_).`);
@@ -95,7 +99,8 @@ async function handleUpdateDocument(documentId, after) {
9599
logs.updateDocument(documentId);
96100
if ((0, validate_1.validateDocumentId)(documentId)) {
97101
const document = (0, adapter_1.adaptDocument)(documentId, after);
98-
await index.addDocuments([document]);
102+
const { taskUid } = await index.addDocuments([document]);
103+
firebase_functions_1.logger.info(`Document update request for document with ID ${documentId} added to task list (task ID ${taskUid}).`);
99104
}
100105
else {
101106
firebase_functions_1.logger.error(`Could not update document with id: ${documentId}.The document id can only contain case-insensitive alphanumeric characters (abcDEF), hyphens (-) or underscores(_).`);

0 commit comments

Comments
 (0)