Skip to content

Commit 1635f24

Browse files
committed
bumped to version 1.0.1+31
1 parent f8be1a9 commit 1635f24

File tree

3 files changed

+80
-36
lines changed

3 files changed

+80
-36
lines changed

lib/apis/providers/api_provider.dart

Lines changed: 72 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,18 @@ class ApiProvider {
209209
return response;
210210
}
211211

212+
/// Send Register OTP
213+
Future<ResponseData> sendRegisterOtp(Map<String, dynamic> body) async {
214+
final response = await _catchAsyncApiError(
215+
endPoint: AppUrls.sendregisterOtpEndpoint,
216+
method: 'POST',
217+
feature: 'Send Register OTP',
218+
body: body,
219+
);
220+
221+
return response;
222+
}
223+
212224
/// Register
213225
Future<ResponseData> register(Map<String, dynamic> body) async {
214226
final response = await _catchAsyncApiError(
@@ -245,24 +257,24 @@ class ApiProvider {
245257
return response;
246258
}
247259

248-
/// Send OTP To Email
249-
Future<ResponseData> sendOtpToEmail(Map<String, dynamic> body) async {
260+
/// Validate User
261+
Future<ResponseData> validateUser(Map<String, dynamic> body) async {
250262
final response = await _catchAsyncApiError(
251-
endPoint: AppUrls.sendOtpToEmailEndpoint,
263+
endPoint: AppUrls.validateUserEndpoint,
252264
method: 'POST',
253-
feature: 'Send OTP To Email',
265+
feature: 'Validate User',
254266
body: body,
255267
);
256268

257269
return response;
258270
}
259271

260-
/// Send Verify Email OTP
261-
Future<ResponseData> sendVerifyEmailOtp(Map<String, dynamic> body) async {
272+
/// Send OTP To Email
273+
Future<ResponseData> sendOtpToEmail(Map<String, dynamic> body) async {
262274
final response = await _catchAsyncApiError(
263-
endPoint: AppUrls.sendVerifyEmailOtpEndpoint,
275+
endPoint: AppUrls.sendOtpToEmailEndpoint,
264276
method: 'POST',
265-
feature: 'Send Verify Email OTP',
277+
feature: 'Send OTP To Email',
266278
body: body,
267279
);
268280

@@ -305,30 +317,6 @@ class ApiProvider {
305317
return response;
306318
}
307319

308-
/// Send Verify Account OTP
309-
Future<ResponseData> sendVerifyAccountOtp(Map<String, dynamic> body) async {
310-
final response = await _catchAsyncApiError(
311-
endPoint: AppUrls.verifyAccountEndpoint,
312-
method: 'POST',
313-
feature: 'Send Verify Account OTP',
314-
body: body,
315-
);
316-
317-
return response;
318-
}
319-
320-
/// Verify Account
321-
Future<ResponseData> verifyAccount(Map<String, dynamic> body) async {
322-
final response = await _catchAsyncApiError(
323-
endPoint: AppUrls.verifyAccountEndpoint,
324-
method: 'PUT',
325-
feature: 'Verify Account',
326-
body: body,
327-
);
328-
329-
return response;
330-
}
331-
332320
/// --------------------------------------------------------------------------
333321
334322
/// Login Info & Location ----------------------------------------------------
@@ -1581,6 +1569,58 @@ class ApiProvider {
15811569

15821570
/// --------------------------------------------------------------------------
15831571
1572+
/// Block --------------------------------------------------------------------
1573+
1574+
/// Block User
1575+
Future<ResponseData> blockUser(String token, String userId) async {
1576+
final response = await _catchAsyncApiError(
1577+
endPoint: AppUrls.blockUserEndpoint,
1578+
method: 'POST',
1579+
feature: 'Block User',
1580+
headers: {"authorization": "Bearer $token"},
1581+
body: {'userId': userId},
1582+
);
1583+
1584+
return response;
1585+
}
1586+
1587+
/// Unblock User
1588+
Future<ResponseData> unblockUser(String token, String userId) async {
1589+
final response = await _catchAsyncApiError(
1590+
endPoint: AppUrls.unblockUserEndpoint,
1591+
method: 'POST',
1592+
feature: 'Unblock User',
1593+
headers: {"authorization": "Bearer $token"},
1594+
body: {'userId': userId},
1595+
);
1596+
1597+
return response;
1598+
}
1599+
1600+
/// Get Blocked Users
1601+
Future<ResponseData> getBlockedUsers(String token,
1602+
{int? page, int? limit}) async {
1603+
var queryParameters = <String, dynamic>{};
1604+
1605+
if (page != null) {
1606+
queryParameters['page'] = page.toString();
1607+
}
1608+
1609+
if (limit != null) {
1610+
queryParameters['limit'] = limit.toString();
1611+
}
1612+
1613+
final response = await _catchAsyncApiError(
1614+
endPoint: AppUrls.getBlockedUsersEndpoint,
1615+
method: 'GET',
1616+
feature: 'Get Blocked Users',
1617+
headers: {"authorization": "Bearer $token"},
1618+
queryParams: queryParameters,
1619+
);
1620+
1621+
return response;
1622+
}
1623+
15841624
/// App Update ---------------------------------------------------------------
15851625
15861626
/// Get Latest App Release Info

lib/constants/urls.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@ abstract class AppUrls {
55

66
/// Endpoints
77
static const serverHealthEndpoint = '/health';
8+
89
static const loginEndpoint = '/login';
910
static const registerEndpoint = '/register';
11+
static const sendregisterOtpEndpoint = '/send-register-otp';
1012
static const forgotPasswordEndpoint = '/forgot-password';
1113
static const resetPasswordEndpoint = '/reset-password';
12-
static const verifyAccountEndpoint = '/verify-account';
14+
static const validateUserEndpoint = '/validate-user';
15+
16+
static const validateTokenEndpoint = '/validate-token';
17+
static const logoutEndpoint = '/logout';
1318

1419
static const sendOtpToEmailEndpoint = '/send-otp-to-email';
15-
static const sendVerifyEmailOtpEndpoint = '/send-verify-email-otp';
1620
static const verifyOtpFromEmailEndpoint = '/verify-email-otp';
1721
static const sendOtpToPhoneEndpoint = '/send-otp-to-phone';
1822
static const verifyOtpFromPhoneEndpoint = '/verify-phone-otp';
@@ -49,7 +53,6 @@ abstract class AppUrls {
4953
static const checkUsernameEndpoint = '/check-username';
5054
static const changeUsernameEndpoint = '/change-username';
5155
static const deleteProfileEndpoint = '/delete-profile';
52-
static const validateTokenEndpoint = '/validate-token';
5356
static const addChangePhoneEndpoint = '/add-change-phone';
5457
static const changeEmailEndpoint = '/change-email';
5558
static const verifyPasswordEndpoint = '/verify-password';
@@ -87,6 +90,7 @@ abstract class AppUrls {
8790

8891
static const blockUserEndpoint = '/block-user';
8992
static const unblockUserEndpoint = '/unblock-user';
93+
static const getBlockedUsersEndpoint = '/get-blocked-users';
9094

9195
static const getNotificationsEndpoint = '/get-notifications';
9296
static const markNotificationsReadEndpoint = '/mark-read-notification';

lib/modules/auth/controllers/register_controller.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class RegisterController extends GetxController {
112112
update();
113113

114114
try {
115-
final response = await _apiProvider.sendVerifyEmailOtp(body);
115+
final response = await _apiProvider.sendRegisterOtp(body);
116116

117117
if (response.isSuccessful) {
118118
final decodedData = response.data;

0 commit comments

Comments
 (0)