added endpoints for object deletion
This commit is contained in:
@@ -57,6 +57,15 @@ class ProductService {
|
||||
if (result.rowCount == 0) throw new customError(`getByLocalId product not found`, responseCodes.responses.products.not_found);
|
||||
return result.rows[0];
|
||||
}
|
||||
|
||||
async getByAbstractProductID(groupId, abstractProductID) {
|
||||
let result = (await db.query("SELECT * FROM products WHERE group_id = $1 AND abstract_product_id = $2", [groupId, abstractProductID]))
|
||||
return result.rows
|
||||
}
|
||||
|
||||
async delete(ID) {
|
||||
await db.query("DELETE FROM products WHERE id = $1", [ID])
|
||||
}
|
||||
};
|
||||
|
||||
export default new ProductService();
|
||||
|
||||
Reference in New Issue
Block a user