added endpoints for retreiving info about items
This commit is contained in:
@@ -51,6 +51,12 @@ class ProductService {
|
||||
if (!result) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
async getByLocalId(groupId, localId) {
|
||||
let result = (await db.query("SELECT * FROM products WHERE group_id = $1 AND local_id = $2", [groupId, localId]));
|
||||
if (result.rowCount == 0) throw new customError(`getByLocalId product not found`, responseCodes.responses.products.not_found);
|
||||
return responseCodes.rows[0];
|
||||
}
|
||||
};
|
||||
|
||||
export default new ProductService();
|
||||
Reference in New Issue
Block a user