fix(users): align otp and profile picture api contracts
This commit is contained in:
@@ -23,7 +23,7 @@ export const sendOtp = async (mobile: string, mode: string) => {
|
||||
export const loginWithOtp = async (mobile: string, otp: string) => {
|
||||
const response = await authFetch('/api/users/otp/login/', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ mobile, otp })
|
||||
body: JSON.stringify({ mobile, code: otp })
|
||||
});
|
||||
if (!response.ok) throw new Error('Failed to login with OTP');
|
||||
return response.json();
|
||||
@@ -70,13 +70,11 @@ export const updateProfilePicture = async (file: File) => {
|
||||
};
|
||||
|
||||
export const removeProfilePicture = async () => {
|
||||
const formData = new FormData();
|
||||
formData.append('profile_picture', '');
|
||||
|
||||
return authFetch(`/api/users/profile/picture/`, {
|
||||
method: 'POST',
|
||||
body: formData,
|
||||
const response = await authFetch(`/api/users/profile/picture/`, {
|
||||
method: 'DELETE',
|
||||
});
|
||||
if (!response.ok) throw new Error('Failed to remove profile picture');
|
||||
return response.json();
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user