set image on server with changing
public static async setAvatar(avatar: ImageFile) {
const userData = await AuthService.getUserData();
return this.handleRequestData<void>(
this.post(
`${ApiUrls.setAvatarImage}/${userData?.id}`,
this.objectToFormData({
user_id: userData?.id,
avatar_url: getFileObjectForImage(avatar),
}),
{ headers: FORM_DATA_HEADER },
),
);
}