mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-02-22 16:22:00 +00:00
- Updated `next.config.ts` to include remote image patterns for user verification. - Introduced `VerifyUserDetails` function in `lib/person.ts` to validate user data against national records. - Added `usePerson` hook for fetching national data based on ID card. - Enhanced `signup` and `signin` functions in `auth-actions.ts` to handle user verification status and send notifications for pending verifications. - Refactored `VerifyUser` function in `user-actions.ts` to incorporate national data validation. - Improved UI components in the user verification page to display both database and national information. - Updated `InputReadOnly` component to support customizable label classes for better styling. These changes improve the user verification process, ensuring data integrity and enhancing the overall user experience.
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;
|
|
}
|