From 07b4239038d183631d788de53c41e338189bb079 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Wed, 16 Jul 2025 17:11:45 +0300 Subject: [PATCH] fix: update error handling in order lifecycle to check for missing time --- src/api/order/content-types/order/lifecycles.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api/order/content-types/order/lifecycles.ts b/src/api/order/content-types/order/lifecycles.ts index 52c3293..1687369 100644 --- a/src/api/order/content-types/order/lifecycles.ts +++ b/src/api/order/content-types/order/lifecycles.ts @@ -1,5 +1,6 @@ import { extractId } from '../../../../utils'; +const ERR_MISSING_TIME = 'Не указано время'; const ERR_INVALID_TIME = 'Некорректное время'; const ERR_OVERLAPPING_TIME = 'Время пересекается с другими заказами'; const ERR_INACTIVE_CLIENT = 'Клиент не активен'; @@ -29,7 +30,7 @@ export default { // Проверка корректности времени заказа. if (!time_start || !time_end) { - throw new Error(ERR_INVALID_TIME); + throw new Error(ERR_MISSING_TIME); } if (timeToDate(time_start) >= timeToDate(time_end)) { throw new Error(ERR_INVALID_TIME);