fix : dio call

This commit is contained in:
2025-05-17 09:08:46 +03:30
parent 3a017b5956
commit b5d6055aa7
6 changed files with 159 additions and 18 deletions

View File

@@ -34,13 +34,15 @@ class AuthRepositoryImpl implements AuthRepository {
@override
Future<CaptchaResponseModel?> captcha() async {
final response = await safeCall(
call:
() async => await _httpClient.post<CaptchaResponseModel>(
'captcha/',
headers: {'Content-Type': 'application/json'},
fromJson: CaptchaResponseModel.fromJson
),
final response = await safeCall<CaptchaResponseModel?>(
call: () async {
var res = await _httpClient.post<CaptchaResponseModel?>(
'captcha/',
fromJson: CaptchaResponseModel.fromJson,
);
return res.data;
},
onSuccess: (response) {
iLog(response);
},
@@ -48,8 +50,7 @@ class AuthRepositoryImpl implements AuthRepository {
throw Exception('Error during captcha : $error');
},
);
return response?.data;
return response;
}
@override