31 lines
904 B
Dart
31 lines
904 B
Dart
import 'package:gsp_app/api/network_api.dart';
|
|
import 'package:gsp_app/repository/endpoints.dart';
|
|
import 'package:gsp_app/repository/services/cj/generate_otp_service.dart';
|
|
|
|
import '../api/base_manager.dart';
|
|
|
|
class ResetPassword {
|
|
Future<ResponseData<dynamic>> resetpasswordapi(updata) async {
|
|
final response =
|
|
await NetworkApi().postApi(url: Endpoints.resetPassword, data: updata);
|
|
|
|
return response;
|
|
}
|
|
|
|
Future<ResponseData<dynamic>> generateOTP(updata) async {
|
|
final response =
|
|
await NetworkApi().postApi(url: Endpoints.generateOTPV2, data: updata);
|
|
|
|
if (response.status == ResponseStatus.SUCCESS) {
|
|
if (response.data['status'] == 200) {
|
|
return response;
|
|
} else if (response.data['status'] == 404) {
|
|
return ResponseData<dynamic>(
|
|
response.data['message'], ResponseStatus.PRIVATE);
|
|
}
|
|
}
|
|
|
|
return response;
|
|
}
|
|
}
|