+ {/* Email */}
+ {/* Phone */}
handleChange("phone", e.target.value)}
+ value={userData.phone_number}
+ onChange={(e) => handleChange("phone_number", e.target.value)}
className="bg-gray-50 py-6"
readOnly={!edit}
/>
diff --git a/lib/auth.ts b/lib/auth.ts
index fddf0bb..29ec95b 100644
--- a/lib/auth.ts
+++ b/lib/auth.ts
@@ -28,7 +28,7 @@ export const login = async (
form: LoginForm,
setToken: SetTokenFn
): Promise => {
- const response = await fetch(`${API_URL}/auth/login`, {
+ const response = await fetch(`${API_URL}/auth/login/`, {
method: "POST",
headers: {
"Content-Type": "application/json",
@@ -50,7 +50,7 @@ export const register = async (
form: RegisterForm,
setToken: SetTokenFn
): Promise => {
- const response = await fetch(`${API_URL}/auth/register`, {
+ const response = await fetch(`${API_URL}/auth/register/`, {
method: "POST",
headers: {
"Content-Type": "application/json",
diff --git a/types/auth.d.ts b/types/auth.d.ts
index abf69a0..9278740 100644
--- a/types/auth.d.ts
+++ b/types/auth.d.ts
@@ -1,10 +1,16 @@
export interface UserData {
- name: string;
- institution: string;
- sscRoll: string;
- hscRoll: string;
+ user_id: string;
+ username: string;
+ full_name: string;
email: string;
- phone: string;
+ is_verified: boolean;
+ phone_number: string;
+ ssc_roll: number;
+ ssc_board: string;
+ hsc_roll: number;
+ hsc_board: string;
+ college: string;
+ preparation_unit: "Science" | "Arts" | "Commerce" | string;
}
export interface RegisterForm {