fixed /api/user/synchronize
This commit is contained in:
		@@ -55,7 +55,7 @@ class AbstractProductService {
 | 
			
		||||
 | 
			
		||||
    async getAll(groupId) {
 | 
			
		||||
        let result = (await db.query("SELECT local_id, barcode, name, net_weight, image_filename, category, unit FROM abstract_products WHERE group_id = $1", [groupId])).rows;
 | 
			
		||||
        if (!result) throw new customError("getAll abstract products not found", responses.responses.abstractproducts.not_found)
 | 
			
		||||
        // if (!result) throw new customError("getAll abstract products not found", responses.responses.abstractproducts.not_found)
 | 
			
		||||
        return result;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -22,6 +22,11 @@ class CategoryService {
 | 
			
		||||
        if (result.rowCount == 0) throw new customError(`getByName categories not found`, responseCodes.responses.category.not_found)
 | 
			
		||||
        return result.rows[0];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    async getAll(groupId) {
 | 
			
		||||
        let result = (await db.query("SELECT group_id, local_id, name FROM categories WHERE group_id = $1", [groupId])).rows
 | 
			
		||||
        return result
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export default new CategoryService();
 | 
			
		||||
@@ -42,7 +42,7 @@ class ProductService {
 | 
			
		||||
 | 
			
		||||
    async getAll(groupId) {
 | 
			
		||||
        let result = (await db.query("SELECT local_id, abstract_product_id, amount, date_of_production, expiry_date FROM products WHERE group_id = $1", [groupId])).rows;
 | 
			
		||||
        if (!result) throw new customError(`getAll product not found`, responseCodes.responses.products.not_found);
 | 
			
		||||
        // if (!result) throw new customError(`getAll product not found`, responseCodes.responses.products.not_found);
 | 
			
		||||
        return result;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user