repair: ErrorCode brand-device

This commit is contained in:
2025-12-18 10:51:19 +07:00
parent 907f5767c1
commit f2c8c3818d
2 changed files with 3 additions and 0 deletions

View File

@@ -180,6 +180,7 @@ class ErrorCodeService {
// Check if there are any error code fields to update // Check if there are any error code fields to update
const hasMainFieldUpdate = const hasMainFieldUpdate =
data.error_code !== undefined ||
data.error_code_name !== undefined || data.error_code_name !== undefined ||
data.error_code_description !== undefined || data.error_code_description !== undefined ||
data.error_code_color !== undefined || data.error_code_color !== undefined ||
@@ -188,6 +189,7 @@ class ErrorCodeService {
if (hasMainFieldUpdate) { if (hasMainFieldUpdate) {
await updateErrorCodeDb(brandId, existingErrorCode.error_code, { await updateErrorCodeDb(brandId, existingErrorCode.error_code, {
error_code: data.error_code,
error_code_name: data.error_code_name, error_code_name: data.error_code_name,
error_code_description: data.error_code_description, error_code_description: data.error_code_description,
error_code_color: data.error_code_color, error_code_color: data.error_code_color,

View File

@@ -44,6 +44,7 @@ const insertErrorCodeSchema = Joi.object({
}); });
const updateErrorCodeSchema = Joi.object({ const updateErrorCodeSchema = Joi.object({
error_code: Joi.string().max(100).optional(),
error_code_name: Joi.string().max(100).optional(), error_code_name: Joi.string().max(100).optional(),
error_code_description: Joi.string().optional().allow(""), error_code_description: Joi.string().optional().allow(""),
error_code_color: Joi.string().optional().allow(""), error_code_color: Joi.string().optional().allow(""),