repair: get errorcodeby brand id

This commit is contained in:
2025-12-04 00:51:41 +07:00
parent c8b2387e4f
commit 6fc21160f5

View File

@@ -4,13 +4,9 @@ const { setResponse, setResponsePaging } = require('../helpers/utils');
class ErrorCodeController {
static async getByBrandId(req, res) {
const { brandId } = req.params;
const queryParams = {
...req.query,
brand_id: brandId
};
const results = await ErrorCodeService.getAllErrorCodes(queryParams);
const response = await setResponsePaging(queryParams, results, 'Error codes found');
const results = await ErrorCodeService.getErrorCodesByBrandId(brandId);
const response = setResponse(results, 'Error codes found');
res.status(response.statusCode).json(response);
}