kyc user and upload partial update encrypt nik and picture

This commit is contained in:
2026-04-27 21:48:24 +07:00
parent b31fe675ae
commit a92b4a8fd9
51 changed files with 5180 additions and 452 deletions
+11
View File
@@ -4,6 +4,7 @@ import { getServerSession } from "next-auth";
import { authOptions } from "@/lib/auth";
import { createTripSchema, tripImageUrlsSchema } from "./schemas";
import { tripService } from "@/server/services/trip.service";
import { organizerService } from "@/server/services/organizer.service";
import { revalidatePath } from "next/cache";
import { tripStoredInstantFromYmd } from "@/lib/trip-dates";
@@ -33,6 +34,16 @@ export async function createTripAction(formData: FormData) {
return { error: result.error.issues[0].message };
}
if (result.data.price > 0) {
const approved = await organizerService.isApproved(session.user.id);
if (!approved) {
return {
error:
"Untuk membuat trip berbayar, akun kamu perlu diverifikasi. Silakan lengkapi verifikasi di /verify.",
};
}
}
const imageUrlsRaw = formData
.getAll("imageUrls")
.map((v) => (v as string).trim())