mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-02-23 04:22:00 +00:00
17 lines
412 B
TypeScript
17 lines
412 B
TypeScript
|
import type { TNationalPerson } from "@/lib/types";
|
||
|
|
||
|
export default async function usePerson({
|
||
|
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;
|
||
|
}
|