add: sparepart in detail notification error

This commit is contained in:
2025-12-05 09:13:41 +07:00
parent 1d3de9ae41
commit 20d035a1ca

View File

@@ -17,6 +17,10 @@ const {
getNotificationErrorLogByNotificationErrorIdDb,
} = require('../db/notification_error_log.db');
const {
getSparepartsByErrorCodeIdDb,
} = require('../db/brand_sparepart.db');
const { getFileUploadByPathDb } = require('../db/file_uploads.db');
const { ErrorHandler } = require('../helpers/error');
@@ -71,10 +75,13 @@ class NotificationService {
})
);
const spareparts = await getSparepartsByErrorCodeIdDb(errorCode.error_code_id);
notification.error_code = {
...errorCode,
solution: solutionsWithDetails
};
notification.spareparts = spareparts;
}
}