fix : dio call
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user