Updated to v1.0.4, fixed admin global page and overall speed
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user