feat: images upload

This commit is contained in:
Ivan Rezchikov
2026-07-04 15:45:05 +03:00
parent 2eb0de5357
commit e192717466
38 changed files with 1334 additions and 615 deletions
+16 -5
View File
@@ -5,17 +5,28 @@ import { getCurrentUser } from "@/lib/user";
import { redirect } from "next/navigation";
import { AccountMenu } from "../../account-menu";
import { getPendingApplications } from "@/lib/citizenship/repository";
import { getImageUrl } from "@/lib/image";
export default async function ReviewPage() {
const user = await getCurrentUser();
if (!user?.isAdmin) redirect("/account/citizenship");
const applications = await getPendingApplications()
const applications = await getPendingApplications();
const applicationsWithWarning = applications.map((app) => ({
...app,
nameMismatch: app.givenNames !== app.user.firstName || app.surname !== app.user.secondName,
}))
const applicationsWithWarning = await Promise.all(
applications.map(async (application) => ({
...application,
profileUrl: await getImageUrl(application.profileKey),
signatureUrl: await getImageUrl(application.signatureKey),
nameMismatch:
application.givenNames !== application.user.firstName ||
application.surname !== application.user.secondName,
previousCitizenship:
application.user._count.citizenships > 0,
}))
);
return (
<>