|
|
|
|
@ -23,6 +23,8 @@ import '../../classes/app_state.dart';
|
|
|
|
|
import '../../models/m_response.dart';
|
|
|
|
|
import '../api_client.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class UserApiClent {
|
|
|
|
|
static final UserApiClent _instance = UserApiClent._internal();
|
|
|
|
|
|
|
|
|
|
@ -45,7 +47,13 @@ class UserApiClent {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<RegisterUser> basicComplete(String userId, String firstName, String lastName, String email, String password) async {
|
|
|
|
|
var postParams = {"userID": userId, "firstName": firstName, "lastName": lastName, "email": email, "companyName": "string", "isEmailVerified": true, "password": password};
|
|
|
|
|
var postParams;
|
|
|
|
|
if(email.isEmpty){
|
|
|
|
|
postParams = {"userID": userId, "firstName": firstName, "lastName": lastName, "companyName": "string", "isEmailVerified": true, "password": password};
|
|
|
|
|
}else{
|
|
|
|
|
postParams = {"userID": userId, "firstName": firstName, "lastName": lastName, "email": email, "companyName": "string", "isEmailVerified": true, "password": password};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return await ApiClient().postJsonForObject((json) => RegisterUser.fromJson(json), ApiConsts.BasicComplete, postParams);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -99,7 +107,7 @@ class UserApiClent {
|
|
|
|
|
Future<Response> ForgetPasswordOTPCompare(String userToken, String userOTP) async {
|
|
|
|
|
var postParams = {"userToken": userToken, "userOTP": userOTP};
|
|
|
|
|
return await ApiClient().postJsonForResponse(ApiConsts.ForgetPasswordOTPCompare, postParams);
|
|
|
|
|
// return await ApiClient().postJsonForObject((json) => PasswordOTPCompare.fromJson(json), ApiConsts.ForgetPasswordOTPCompare, postParams);
|
|
|
|
|
// return await ApiClient().postJsonForObject((json) => PasswordOTPCompare.fromJson(json), ApiConsts.ForgetPasswordOTPCompare, postParams);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<Response> ForgetPassword(String userToken, String newPassword) async {
|
|
|
|
|
@ -121,6 +129,7 @@ class UserApiClent {
|
|
|
|
|
String t = AppState().getUser.data!.accessToken ?? "";
|
|
|
|
|
print("tokeen " + t);
|
|
|
|
|
return await ApiClient().postJsonForObject((json) => MResponse.fromJson(json), ApiConsts.ChangePassword, postParams, token: t);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<ChangeMobile> ChangeMobileNoOTPRequest(
|
|
|
|
|
@ -166,11 +175,13 @@ class UserApiClent {
|
|
|
|
|
return await ApiClient().postJsonForObject((json) => VerifyEmail.fromJson(json), ApiConsts.EmailVerify, postParams, token: t);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<VerifyEmailOTP> EmailVerifyOTPVerify(String userToken, String userOTP) async {
|
|
|
|
|
var postParams = {"userToken": userToken, "userOTP": userOTP};
|
|
|
|
|
Future<MResponse> EmailVerifyOTPVerify(String userToken, String userOTP) async {
|
|
|
|
|
var postParams =
|
|
|
|
|
{"userToken": userToken,
|
|
|
|
|
"userOTP": userOTP};
|
|
|
|
|
|
|
|
|
|
String t = AppState().getUser.data!.accessToken ?? "";
|
|
|
|
|
return await ApiClient().postJsonForObject((json) => VerifyEmailOTP.fromJson(json), ApiConsts.EmailVerifyOTPVerify, postParams, token: t);
|
|
|
|
|
return await ApiClient().postJsonForObject((json) => MResponse.fromJson(json), ApiConsts.EmailVerifyOTPVerify, postParams, token: t);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<Response> UpdateUserImage(String image) async {
|
|
|
|
|
|