This commit is contained in:
Surya Paolo
2024-01-13 16:21:07 +01:00
parent 7bf549569d
commit 79ca364e84
5 changed files with 23 additions and 6 deletions

View File

@@ -193,15 +193,20 @@ module.exports.getProductById = async function (id) {
return arrris && arrris.length > 0 ? arrris[0] : null
}
module.exports.findAllIdApp = async function (idapp, code, id) {
module.exports.findAllIdApp = async function (idapp, code, id, all) {
let myfind = {};
let myqueryadd = {};
let query = [];
try {
if (idapp)
myfind = { idapp, active: true };
if (idapp){
myfind = { idapp };
}
if (!all) {
myfind = { ...myfind, active: true }
}
if (code) {
myfind = { ...myfind, code }