;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
This commit is contained in:
		@@ -2,7 +2,7 @@ import AbstractProductService from '../services/abstractproduct.js';
 | 
			
		||||
import statuses from '../utils/status.js';
 | 
			
		||||
import log from '../utils/log.js';
 | 
			
		||||
 | 
			
		||||
const TAG = "/controllers/abstractproduct.js"
 | 
			
		||||
const TAG = "/controllers/abstractproduct.js";
 | 
			
		||||
 | 
			
		||||
class AbstractProductController {
 | 
			
		||||
    async create(req, res) {
 | 
			
		||||
@@ -15,8 +15,8 @@ class AbstractProductController {
 | 
			
		||||
                case statuses.duplicate:
 | 
			
		||||
                    return res.status(400).send(e.message);
 | 
			
		||||
                default:
 | 
			
		||||
                    log.error(e.original)
 | 
			
		||||
                    return res.status(500).send(e.message)
 | 
			
		||||
                    log.error(e.original);
 | 
			
		||||
                    return res.status(500).send(e.message);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,5 @@
 | 
			
		||||
import CategoryService from "../services/category.js";
 | 
			
		||||
import log
 | 
			
		||||
    from "../utils/log.js";
 | 
			
		||||
import log from "../utils/log.js";
 | 
			
		||||
const TAG = "controllers/category.js";
 | 
			
		||||
 | 
			
		||||
class CategoryController {
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@ import config from '../../config.json' with {type: "json"};
 | 
			
		||||
import statuses from '../utils/status.js';
 | 
			
		||||
import log from '../utils/log.js';
 | 
			
		||||
 | 
			
		||||
const TAG = "/controllers/group.js"
 | 
			
		||||
const TAG = "/controllers/group.js";
 | 
			
		||||
 | 
			
		||||
class GroupController {
 | 
			
		||||
    async create(req, res) {
 | 
			
		||||
 
 | 
			
		||||
@@ -28,7 +28,7 @@ class AbstractProductController {
 | 
			
		||||
 | 
			
		||||
            if (abstract_product_id) await ProductService.updateAbstractProductId(groupId, localId, abstract_product_id);
 | 
			
		||||
 | 
			
		||||
            if (amount) await ProductService.updateAmount(groupId, localId, amount)
 | 
			
		||||
            if (amount) await ProductService.updateAmount(groupId, localId, amount);
 | 
			
		||||
 | 
			
		||||
            if (date_of_production) await ProductService.updateDateOfProduction(groupId, localId, date_of_production);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@ class UserController {
 | 
			
		||||
            await UserService.create(username, password);
 | 
			
		||||
 | 
			
		||||
            log.info(`New user with name ${username} has just registered`);
 | 
			
		||||
            return res.status(200).send("Successfull register")
 | 
			
		||||
            return res.status(200).send("Successfull register");
 | 
			
		||||
        } catch (e) { res.status(500).send(log.unknownError(`${TAG}/register: ${e}`)); }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -35,10 +35,10 @@ class UserController {
 | 
			
		||||
        try {
 | 
			
		||||
            const { groupId } = req.params;
 | 
			
		||||
 | 
			
		||||
            let result = {}
 | 
			
		||||
            let result = {};
 | 
			
		||||
            result.abstract_products = await AbstractProductService.getAll(groupId);
 | 
			
		||||
            result.products = await ProductService.getAll(groupId);
 | 
			
		||||
            // result.categories = await CategoryService.getAll(groupId);
 | 
			
		||||
            result.categories = await CategoryService.getAll(groupId);
 | 
			
		||||
 | 
			
		||||
            return res.status(200).json(result);
 | 
			
		||||
        } catch (e) { res.status(500).send(log.unknownError(`${TAG}/synchronize: ${e}`)); }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user