diff --git a/app/api/admin/department-reset/route.ts b/app/api/admin/department-reset/route.ts index a842d44..257098c 100644 --- a/app/api/admin/department-reset/route.ts +++ b/app/api/admin/department-reset/route.ts @@ -34,10 +34,10 @@ export async function POST(request: NextRequest) { if (lastReset.length > 0) { const lastResetTime = new Date(lastReset[0].timestamp).getTime() const now = new Date().getTime() - const cooldownMs = 90 * 10 // 1.5 minutes for department resets + const cooldownMs = 30 * 10 // 1.5 minutes for department resets if (now - lastResetTime < cooldownMs) { - return NextResponse.json({ error: "יש להמתין 90 שניות בין איפוסי מסגרת" }, { status: 429 }) + return NextResponse.json({ error: "יש להמתין 30 שניות בין איפוסי מסגרת" }, { status: 429 }) } } @@ -47,6 +47,8 @@ export async function POST(request: NextRequest) { [adminField, adminDepartment], ) + console.log(`Department reset was called by: ${adminId}`) + // Get count of locked users that were skipped const lockedUsers = (await safeQuery( "SELECT COUNT(*) as count FROM users WHERE field = ? AND department = ? AND lock_status = TRUE",