fix registrasi
deskripsi: - fix registrasi dan middleware
This commit is contained in:
@@ -3,6 +3,7 @@ export {
|
||||
apiGetCheckCodeOtp,
|
||||
apiPostVerifikasiCodeOtp,
|
||||
apiDeleteAktivasiKodeOtpByNomor,
|
||||
apiFetchRegister,
|
||||
};
|
||||
|
||||
const apiFetchLogin = async ({ nomor }: { nomor: string }) => {
|
||||
@@ -43,7 +44,30 @@ const apiDeleteAktivasiKodeOtpByNomor = async ({ id }: { id: string }) => {
|
||||
},
|
||||
});
|
||||
|
||||
console.log("respone delete", await respone.json());
|
||||
|
||||
return await respone.json().catch(() => null);
|
||||
};
|
||||
|
||||
const apiFetchRegister = async ({
|
||||
nomor,
|
||||
username,
|
||||
}: {
|
||||
nomor: string;
|
||||
username: string;
|
||||
}) => {
|
||||
const data = {
|
||||
username: username,
|
||||
nomor: nomor,
|
||||
};
|
||||
const respone = await fetch("/api/auth/register", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ data }),
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
const result = await respone.json();
|
||||
|
||||
return result;
|
||||
// return await respone.json().catch(() => null);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user