mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-13 11:05:48 +00:00
20 lines
428 B
TypeScript
20 lines
428 B
TypeScript
"use server";
|
|
import type { TNationalPerson } from "@/lib/types";
|
|
|
|
export async function getNationalPerson({
|
|
idCard,
|
|
}: { idCard: string }): Promise<TNationalPerson> {
|
|
const nationalInformation = await fetch(
|
|
`${process.env.PERSON_VERIFY_API_BASE}/api/person/${idCard}`,
|
|
{
|
|
next: {
|
|
revalidate: 60,
|
|
},
|
|
},
|
|
);
|
|
const nationalData = (await nationalInformation.json()) as TNationalPerson;
|
|
return nationalData;
|
|
}
|
|
|
|
|