order: fix order update state lifecycle

This commit is contained in:
vchikalkin 2025-06-25 12:20:14 +03:00
parent 065da3e275
commit 2074955d19

View File

@ -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);