mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
Pulled main changes
This commit is contained in:
@ -17,7 +17,6 @@ import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
import 'package:syncrow_web/utils/extension/build_context_x.dart';
|
||||
import 'package:syncrow_web/utils/style.dart';
|
||||
|
||||
class UsersPage extends StatelessWidget {
|
||||
UsersPage({super.key});
|
||||
|
||||
|
@ -34,9 +34,8 @@ class UserPermissionApi {
|
||||
path: ApiEndpoints.roleTypes,
|
||||
showServerMessage: true,
|
||||
expectedResponseModel: (json) {
|
||||
final List<RoleTypeModel> fetchedRoles = (json['data'] as List)
|
||||
.map((item) => RoleTypeModel.fromJson(item))
|
||||
.toList();
|
||||
final List<RoleTypeModel> fetchedRoles =
|
||||
(json['data'] as List).map((item) => RoleTypeModel.fromJson(item)).toList();
|
||||
return fetchedRoles;
|
||||
},
|
||||
);
|
||||
@ -48,9 +47,7 @@ class UserPermissionApi {
|
||||
path: ApiEndpoints.permission.replaceAll("roleUuid", roleUuid),
|
||||
showServerMessage: true,
|
||||
expectedResponseModel: (json) {
|
||||
return (json as List)
|
||||
.map((data) => PermissionOption.fromJson(data))
|
||||
.toList();
|
||||
return (json as List).map((data) => PermissionOption.fromJson(data)).toList();
|
||||
},
|
||||
);
|
||||
return response ?? [];
|
||||
@ -195,14 +192,10 @@ class UserPermissionApi {
|
||||
|
||||
Future<bool> changeUserStatusById(userUuid, status, String projectUuid) async {
|
||||
try {
|
||||
Map<String, dynamic> bodya = {
|
||||
"disable": status,
|
||||
"projectUuid": projectUuid
|
||||
};
|
||||
Map<String, dynamic> bodya = {"disable": status, "projectUuid": projectUuid};
|
||||
|
||||
final response = await _httpService.put(
|
||||
path: ApiEndpoints.changeUserStatus
|
||||
.replaceAll("{invitedUserUuid}", userUuid),
|
||||
path: ApiEndpoints.changeUserStatus.replaceAll("{invitedUserUuid}", userUuid),
|
||||
body: bodya,
|
||||
expectedResponseModel: (json) {
|
||||
return json['success'];
|
||||
|
@ -1,7 +1,7 @@
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
|
||||
abstract class ApiEndpoints {
|
||||
static const String projectUuid = "0e62577c-06fa-41b9-8a92-99a21fbaf51c";
|
||||
static const String projectUuid = "bcda711e-9fc2-4168-a05e-171b4026d1ff";
|
||||
static String baseUrl = dotenv.env['BASE_URL'] ?? '';
|
||||
static const String signUp = '/authentication/user/signup';
|
||||
static const String login = '/authentication/user/login';
|
||||
|
@ -1,3 +1,3 @@
|
||||
class TempConst {
|
||||
static const projectId = '0e62577c-06fa-41b9-8a92-99a21fbaf51c';
|
||||
static const projectId = 'bcda711e-9fc2-4168-a05e-171b4026d1ff';
|
||||
}
|
||||
|
Reference in New Issue
Block a user