awaitdb.query("UPDATE abstract_products SET image_filename = $1 WHERE group_id = $2 AND local_id = $3",[image_filename,groupId,localId])
.catch((e)=>{
errorHandler(e,"image filename")
});
}
asyncupdateCategory(groupId,localId,category){
awaitdb.query("UPDATE abstract_products SET category = $1 WHERE group_id = $2 AND local_id = $3",[category,groupId,localId])
.catch((e)=>{
errorHandler(e,"category")
});
}
asyncupdateUnit(groupId,localId,unit){
awaitdb.query("UPDATE abstract_products SET unit = $1 WHERE group_id = $2 AND local_id = $3",[unit,groupId,localId])
.catch((e)=>{
errorHandler(e,"unit")
});
}
asyncgetAll(groupId){
letresult=(awaitdb.query("SELECT local_id, barcode, name, net_weight, image_filename, category, unit FROM abstract_products WHERE group_id = $1",[groupId])).rows
if(!result)returnstatuses.not_found;
returnresult
}
asyncexists(groupId,localId){
letresult=(awaitdb.query("SELECT * FROM abstract_products WHERE group_id = $1 AND local_id = $2",[groupId,localId])).rowCount;