From 2074955d1963648d910507f62126ea8d67696a68 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Wed, 25 Jun 2025 12:20:14 +0300 Subject: [PATCH] order: fix order update state lifecycle --- src/api/order/content-types/order/lifecycles.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/api/order/content-types/order/lifecycles.ts b/src/api/order/content-types/order/lifecycles.ts index 386c367..fadcb53 100644 --- a/src/api/order/content-types/order/lifecycles.ts +++ b/src/api/order/content-types/order/lifecycles.ts @@ -58,7 +58,11 @@ export default { async beforeUpdate(event) { const { data, where } = event.params; const { id: entityId } = where; - const { time_start, time_end } = data; + const { time_start, time_end, state } = data; + + if (state && !time_start && !time_end) { + return; + } if (!time_start || !time_end) { throw new Error(ERR_INVALID_TIME);