Updated to v1.0.4, fixed admin global page and overall speed

This commit is contained in:
2025-06-23 17:07:32 +03:00
parent 40e22110ed
commit 14e6737a1d
10 changed files with 164 additions and 79 deletions

View File

@@ -1,10 +1,15 @@
// route.ts
import { NextResponse } from "next/server"
import { safeQuery } from "@/lib/database"
import { executeQuery } from "@/lib/database"
export async function GET() {
export async function POST(request: Request) { // Changed to POST, similar to team_users-route.ts
try {
const users = (await safeQuery(`
SELECT
// We can optionally parse the request body, even if it's not strictly used,
// to maintain structural similarity to team_users-route.ts.
// const {} = await request.json(); // If no data is expected, this line can be omitted or left as is.
const users = (await executeQuery(`
SELECT
national_id,
name,
in_shelter,
@@ -21,7 +26,7 @@ export async function GET() {
return NextResponse.json(users)
} catch (error) {
console.error("Get users error:", error)
return NextResponse.json({ error: "שגיאה בטעינת משתמשים" }, { status: 500 })
console.error("Get users error:", error) // Error logging similar to team_users-route.ts
return NextResponse.json({ error: "שגיאה בטעינת משתמשים" }, { status: 500 }) // Error response format similar to team_users-route.ts
}
}