(solved)http-function multiple collections call

Thanks! I actually just kept the phrase together in each switch statement case so it could tell which data query it was suppose to do :), example below:


case ‘doctorDatabase’:
return wixData.query(“Doctor_Database”)
.eq(“npi_id”, doctorID) //check the first value with items in the Patient_ID column
.find()
.then((results1) => {
// matching items were found
if (results1.items.length > 0) {
options.body = {
“success”: ‘true’,
“items”: results1.items
};
return ok(options);
}

                                 // no matching items found 
                                    options.body = { 
                                           "success": 'false', 
                                           "error": `${doctorID} was not found inside the ${collectionName} Collection` 
                                    }; 
                                     **return**  notFound(options); 
                                });