{"size": 668, "ext": "js", "max_stars_repo_path": "backend/src/controllers/ClothingManage/sizeManage.controller.js", "max_stars_repo_name": "RuddyQuispe/e-comerce-catbol-backend", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "backend/src/controllers/ClothingManage/sizeManage.controller.js", "max_issues_repo_name": "RuddyQuispe/e-comerce-catbol-backend", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "backend/src/controllers/ClothingManage/sizeManage.controller.js", "max_forks_repo_name": "RuddyQuispe/e-comerce-catbol-backend", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.6923076923, "max_line_length": 95, "alphanum_fraction": 0.5883233533}
const sizeModel = require('../../models/ClothingManage/sizeManage.model');

const getSize = async (req, res) => {
    const sizeList = await sizeModel.getListOptionsSize();
    res.json({
        size_list : sizeList
    });
}

const postSize = async (req, res) => {
    const idSize = await sizeModel.registerSize(req.body.size);
    if (idSize>0) {
        res.json({
            message : `El Registro de la talla ${req.body.size} fue exitoso ID: ${idSize}`
        });
    } else {
        res.json({
            message : `El Registro de la talla ${req.body.size} falló, probablemente ya existe`
        });
    }
}

module.exports = {
    getSize,
    postSize
}