mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-02 03:38:22 +00:00
feat: implement checkTempIdOrPhone function and update OTP verification logic
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 1m29s
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 1m29s
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
"use server";
|
||||
import {
|
||||
type ActionState,
|
||||
type FilterTempUserResponse,
|
||||
type FilterUserResponse,
|
||||
backendMobileLogin,
|
||||
} from "@/actions/auth-actions";
|
||||
@ -72,6 +73,23 @@ export async function checkIdOrPhone({
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function checkTempIdOrPhone({
|
||||
id_card,
|
||||
phone_number,
|
||||
}: { id_card?: string; phone_number?: string }) {
|
||||
const response = await fetch(
|
||||
`${process.env.SARLINK_API_BASE_URL}/api/auth/users/temp/filter/?id_card=${id_card}&mobile=${phone_number}`,
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
},
|
||||
);
|
||||
const data = (await response.json()) as FilterTempUserResponse;
|
||||
return data;
|
||||
}
|
||||
|
||||
type TSignupUser = Pick<
|
||||
User,
|
||||
"username" | "address" | "mobile" | "id_card" | "dob"
|
||||
|
Reference in New Issue
Block a user