You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
1.2 KiB
Dart
28 lines
1.2 KiB
Dart
import 'package:tangheem/classes/consts.dart';
|
|
import 'package:tangheem/models/general_response_model.dart';
|
|
import 'api_client.dart';
|
|
|
|
class UserApiClient {
|
|
static final UserApiClient _instance = UserApiClient._internal();
|
|
UserApiClient._internal();
|
|
factory UserApiClient() => _instance;
|
|
|
|
Future<GeneralResponseModel> forgotPassword(String _email) async {
|
|
String url = "${ApiConsts.user}ForgotPassword";
|
|
var postParams = {"email": _email};
|
|
return await ApiClient().postJsonForObject((json) => GeneralResponseModel.fromJson(json), url, postParams);
|
|
}
|
|
|
|
Future<GeneralResponseModel> verifyOTP(String _email, int _otp) async {
|
|
String url = "${ApiConsts.user}OTPVerification";
|
|
var postParams = {"email": _email, "opt": _otp};
|
|
return await ApiClient().postJsonForObject((json) => GeneralResponseModel.fromJson(json), url, postParams);
|
|
}
|
|
|
|
Future<GeneralResponseModel> updatePassword(String _email, int _otp, String _password) async {
|
|
String url = "${ApiConsts.user}UpdatePassword";
|
|
var postParams = {"email": _email, "opt": _otp, "newPassword": _password, "confirmPassword": _password};
|
|
return await ApiClient().postJsonForObject((json) => GeneralResponseModel.fromJson(json), url, postParams);
|
|
}
|
|
}
|