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/constants/assets.dart';
|
||||||
import 'package:syncrow_web/utils/extension/build_context_x.dart';
|
import 'package:syncrow_web/utils/extension/build_context_x.dart';
|
||||||
import 'package:syncrow_web/utils/style.dart';
|
import 'package:syncrow_web/utils/style.dart';
|
||||||
|
|
||||||
class UsersPage extends StatelessWidget {
|
class UsersPage extends StatelessWidget {
|
||||||
UsersPage({super.key});
|
UsersPage({super.key});
|
||||||
|
|
||||||
|
@ -34,9 +34,8 @@ class UserPermissionApi {
|
|||||||
path: ApiEndpoints.roleTypes,
|
path: ApiEndpoints.roleTypes,
|
||||||
showServerMessage: true,
|
showServerMessage: true,
|
||||||
expectedResponseModel: (json) {
|
expectedResponseModel: (json) {
|
||||||
final List<RoleTypeModel> fetchedRoles = (json['data'] as List)
|
final List<RoleTypeModel> fetchedRoles =
|
||||||
.map((item) => RoleTypeModel.fromJson(item))
|
(json['data'] as List).map((item) => RoleTypeModel.fromJson(item)).toList();
|
||||||
.toList();
|
|
||||||
return fetchedRoles;
|
return fetchedRoles;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -48,9 +47,7 @@ class UserPermissionApi {
|
|||||||
path: ApiEndpoints.permission.replaceAll("roleUuid", roleUuid),
|
path: ApiEndpoints.permission.replaceAll("roleUuid", roleUuid),
|
||||||
showServerMessage: true,
|
showServerMessage: true,
|
||||||
expectedResponseModel: (json) {
|
expectedResponseModel: (json) {
|
||||||
return (json as List)
|
return (json as List).map((data) => PermissionOption.fromJson(data)).toList();
|
||||||
.map((data) => PermissionOption.fromJson(data))
|
|
||||||
.toList();
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
return response ?? [];
|
return response ?? [];
|
||||||
@ -195,14 +192,10 @@ class UserPermissionApi {
|
|||||||
|
|
||||||
Future<bool> changeUserStatusById(userUuid, status, String projectUuid) async {
|
Future<bool> changeUserStatusById(userUuid, status, String projectUuid) async {
|
||||||
try {
|
try {
|
||||||
Map<String, dynamic> bodya = {
|
Map<String, dynamic> bodya = {"disable": status, "projectUuid": projectUuid};
|
||||||
"disable": status,
|
|
||||||
"projectUuid": projectUuid
|
|
||||||
};
|
|
||||||
|
|
||||||
final response = await _httpService.put(
|
final response = await _httpService.put(
|
||||||
path: ApiEndpoints.changeUserStatus
|
path: ApiEndpoints.changeUserStatus.replaceAll("{invitedUserUuid}", userUuid),
|
||||||
.replaceAll("{invitedUserUuid}", userUuid),
|
|
||||||
body: bodya,
|
body: bodya,
|
||||||
expectedResponseModel: (json) {
|
expectedResponseModel: (json) {
|
||||||
return json['success'];
|
return json['success'];
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||||
|
|
||||||
abstract class ApiEndpoints {
|
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 String baseUrl = dotenv.env['BASE_URL'] ?? '';
|
||||||
static const String signUp = '/authentication/user/signup';
|
static const String signUp = '/authentication/user/signup';
|
||||||
static const String login = '/authentication/user/login';
|
static const String login = '/authentication/user/login';
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
class TempConst {
|
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