From 2f96ac2d8659ae61fda8b22a434327bc41e505b9 Mon Sep 17 00:00:00 2001 From: Pritimay Sarkar Date: Mon, 23 Oct 2023 03:23:50 +0530 Subject: [PATCH] add search fields --- cloud-functions/nodejs/functions/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cloud-functions/nodejs/functions/index.js b/cloud-functions/nodejs/functions/index.js index 35db8d2..8f70b54 100644 --- a/cloud-functions/nodejs/functions/index.js +++ b/cloud-functions/nodejs/functions/index.js @@ -279,4 +279,13 @@ exports.retestMarking = async (event, context) => { }); }) } + + const {_idSearch, abhaIdSearch, aadharIdSearch} = event.value.fields; + if (!_idSearch?.stringValue) { + await admin.firestore().collection("patientData").doc(doc.id).update({ + _idSearch: `${moment().format('YYYYMMDD')}${_id}`, + abhaIdSearch: `${moment().format('YYYYMMDD')}${abhaId}`, + aadharIdSearch: `${moment().format('YYYYMMDD')}${aadharId}`, + }); + } };