From df8140d5ddbe3b7f98531e60d81d8af4acc9a5d6 Mon Sep 17 00:00:00 2001 From: Tom Ruff Date: Mon, 23 Jun 2025 12:46:01 +0300 Subject: [PATCH] Update app/api/admin/department-reset/route.ts --- app/api/admin/department-reset/route.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/api/admin/department-reset/route.ts b/app/api/admin/department-reset/route.ts index 257098c..d7b20ce 100644 --- a/app/api/admin/department-reset/route.ts +++ b/app/api/admin/department-reset/route.ts @@ -37,8 +37,10 @@ export async function POST(request: NextRequest) { const cooldownMs = 30 * 10 // 1.5 minutes for department resets if (now - lastResetTime < cooldownMs) { - return NextResponse.json({ error: "יש להמתין 30 שניות בין איפוסי מסגרת" }, { status: 429 }) + const remainingSeconds = Math.ceil((cooldownMs - (now - lastResetTime)) / 1000) + return NextResponse.json({ error: "יש להמתין 30 שניות בין איפוסי מסגרת", remainingSeconds }, { status: 429 }) } + } // Reset department users' statuses with field and department context, but exclude locked users