wisdom #19

Merged
bragaz_rexita merged 38 commits from wisdom into main 2025-12-22 09:18:18 +00:00
Showing only changes of commit 6fc21160f5 - Show all commits

View File

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