From 7a89cfa7ce9af9254209ba2d8d712c65d74b1a7b Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Sat, 2 Aug 2025 18:37:42 +0300 Subject: [PATCH] fix: update slot start time validation to check against the current day - Modified the validation logic to ensure that the slot start time is not before the current day, preventing past slots from being created. --- src/api/slot/content-types/slot/lifecycles.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/slot/content-types/slot/lifecycles.ts b/src/api/slot/content-types/slot/lifecycles.ts index 5d12975..27cad7e 100644 --- a/src/api/slot/content-types/slot/lifecycles.ts +++ b/src/api/slot/content-types/slot/lifecycles.ts @@ -40,7 +40,7 @@ export default { if (datetime_start) { const now = dayjs().tz(DEFAULT_TZ); const slotStart = dayjs(datetime_start).tz(DEFAULT_TZ); - if (slotStart.isBefore(now, 'minute')) { + if (slotStart.isBefore(now, 'day')) { throw new Error(ERR_PAST_SLOT); } }