Skip to content

Add some missing build files #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions functions/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ async function handleAddDocument(documentId, snapshot) {
logs.addDocument(documentId);
if ((0, validate_1.validateDocumentId)(documentId)) {
const document = (0, adapter_1.adaptDocument)(documentId, snapshot);
await index.addDocuments([document], { primaryKey: '_firestore_id' });
const { taskUid } = await index.addDocuments([document], {
primaryKey: '_firestore_id',
});
firebase_functions_1.logger.info(`Document addition request for document with ID ${documentId} added to task list (task ID ${taskUid}).`);
}
else {
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(_).`);
Expand All @@ -75,7 +78,8 @@ async function handleDeleteDocument(documentId) {
try {
logs.deleteDocument(documentId);
if ((0, validate_1.validateDocumentId)(documentId)) {
await index.deleteDocument(documentId);
const { taskUid } = await index.deleteDocument(documentId);
firebase_functions_1.logger.info(`Document deletion request for document with ID ${documentId} added to task list (task ID ${taskUid}).`);
}
else {
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(_).`);
Expand All @@ -95,7 +99,8 @@ async function handleUpdateDocument(documentId, after) {
logs.updateDocument(documentId);
if ((0, validate_1.validateDocumentId)(documentId)) {
const document = (0, adapter_1.adaptDocument)(documentId, after);
await index.addDocuments([document]);
const { taskUid } = await index.addDocuments([document]);
firebase_functions_1.logger.info(`Document update request for document with ID ${documentId} added to task list (task ID ${taskUid}).`);
}
else {
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(_).`);
Expand Down
Loading