first action update user pages .

2-update driver pages [fixed image display and notyfi]
3-update car pages [fixed image]
4-build tripe pages crud
5-build some role pages
6-build audit page
7-update ui compounants
8-update saidebar and topbar
9-cheange view to be ar view
10-cheange stractcher to be app,src
11-add validation layer by yup
12-add api image-proxy to broke image corse bloken
This commit is contained in:
m7amedez5511
2026-06-23 15:54:07 +03:00
parent c1b77f89cd
commit db64b79fe3
140 changed files with 9266 additions and 2449 deletions

View File

@@ -0,0 +1,35 @@
import { NextRequest, NextResponse } from "next/server";
const BACKEND_BASE = "https://logiapi.slash.sa";
export async function GET(
_req: NextRequest,
{ params }: { params: Promise<{ filename: string }> },
) {
const { filename } = await params;
try {
const upstream = await fetch(
`${BACKEND_BASE}/public/uploads/driver-photos/${filename}`,
{ cache: "no-store" },
);
if (!upstream.ok) {
return new NextResponse(null, { status: upstream.status });
}
const buffer = await upstream.arrayBuffer();
const contentType =
upstream.headers.get("Content-Type") ?? "image/jpeg";
return new NextResponse(buffer, {
status: 200,
headers: {
"Content-Type": contentType,
"Cache-Control": "public, max-age=3600, stale-while-revalidate=86400",
},
});
} catch {
return new NextResponse(null, { status: 502 });
}
}