userdetails,resetpass müködöképes lett
This commit is contained in:
@@ -57,4 +57,53 @@ export const verifyEmail = async (token) => {
|
||||
}
|
||||
};
|
||||
|
||||
// Get current user profile
|
||||
export const getUserProfile = async () => {
|
||||
try {
|
||||
const response = await apiClient.get("/users/profile");
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
// Update current user profile
|
||||
export const updateUserProfile = async (data) => {
|
||||
try {
|
||||
const response = await apiClient.patch("/users/profile", data);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
// Delete current user profile
|
||||
export const deleteUserProfile = async () => {
|
||||
try {
|
||||
const response = await apiClient.delete("/users/profile");
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
// Request password reset
|
||||
export const forgotPassword = async (email) => {
|
||||
try {
|
||||
const response = await apiClient.post("/users/forgot-password", { email });
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
// Reset password with token
|
||||
export const resetPassword = async (token, newPassword) => {
|
||||
try {
|
||||
const response = await apiClient.post("/users/reset-password", { token, newPassword });
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user