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

This commit is contained in:
2025-04-18 13:50:58 +05:00
parent 4127035471
commit f3f5800df6
3 changed files with 29 additions and 4 deletions

View File

@ -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"