mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-27 01:44:55 +00:00
create subspace
This commit is contained in:
@ -4,7 +4,8 @@ import 'package:syncrow_app/services/api/http_service.dart';
|
||||
class HomeCreation {
|
||||
static final HTTPService _httpService = HTTPService();
|
||||
|
||||
static Future<Map<String, dynamic>> createCommunity(Map<String, String> body) async {
|
||||
static Future<Map<String, dynamic>> createCommunity(
|
||||
Map<String, String> body) async {
|
||||
try {
|
||||
final response = await _httpService.post(
|
||||
path: ApiEndpoints.addCommunity,
|
||||
@ -20,7 +21,8 @@ class HomeCreation {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<Map<String, dynamic>> assignUserToCommunity(Map<String, String> body) async {
|
||||
static Future<Map<String, dynamic>> assignUserToCommunity(
|
||||
Map<String, String> body) async {
|
||||
try {
|
||||
final response = await _httpService.post(
|
||||
path: ApiEndpoints.addCommunityToUser,
|
||||
@ -36,7 +38,8 @@ class HomeCreation {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<Map<String, dynamic>> createBuilding(Map<String, String> body) async {
|
||||
static Future<Map<String, dynamic>> createBuilding(
|
||||
Map<String, String> body) async {
|
||||
try {
|
||||
final response = await _httpService.post(
|
||||
path: ApiEndpoints.addBuilding,
|
||||
@ -52,7 +55,8 @@ class HomeCreation {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<Map<String, dynamic>> assignUserToBuilding(Map<String, String> body) async {
|
||||
static Future<Map<String, dynamic>> assignUserToBuilding(
|
||||
Map<String, String> body) async {
|
||||
try {
|
||||
final response = await _httpService.post(
|
||||
path: ApiEndpoints.addBuildingToUser,
|
||||
@ -68,7 +72,8 @@ class HomeCreation {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<Map<String, dynamic>> createFloor(Map<String, String> body) async {
|
||||
static Future<Map<String, dynamic>> createFloor(
|
||||
Map<String, String> body) async {
|
||||
try {
|
||||
final response = await _httpService.post(
|
||||
path: ApiEndpoints.addFloor,
|
||||
@ -84,7 +89,8 @@ class HomeCreation {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<Map<String, dynamic>> assignUserToFloor(Map<String, String> body) async {
|
||||
static Future<Map<String, dynamic>> assignUserToFloor(
|
||||
Map<String, String> body) async {
|
||||
try {
|
||||
final response = await _httpService.post(
|
||||
path: ApiEndpoints.addBuildingToUser,
|
||||
@ -100,7 +106,8 @@ class HomeCreation {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<Map<String, dynamic>> createUnit(Map<String, String> body) async {
|
||||
static Future<Map<String, dynamic>> createUnit(
|
||||
Map<String, String> body) async {
|
||||
try {
|
||||
final response = await _httpService.post(
|
||||
path: ApiEndpoints.addUnit,
|
||||
@ -116,7 +123,8 @@ class HomeCreation {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<Map<String, dynamic>> assignUserToUnit(Map<String, String> body) async {
|
||||
static Future<Map<String, dynamic>> assignUserToUnit(
|
||||
Map<String, String> body) async {
|
||||
try {
|
||||
final response = await _httpService.post(
|
||||
path: ApiEndpoints.addUnitToUser,
|
||||
@ -132,10 +140,17 @@ class HomeCreation {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<Map<String, dynamic>> createRoom(Map<String, String> body) async {
|
||||
static Future<Map<String, dynamic>> createRoom({
|
||||
required String communityId,
|
||||
required String spaceId,
|
||||
required Map<String, String> body,
|
||||
}) async {
|
||||
try {
|
||||
final fullPath = ApiEndpoints.addSubSpace
|
||||
.replaceAll('{communityUuid}', communityId)
|
||||
.replaceAll('{spaceUuid}', spaceId);
|
||||
final response = await _httpService.post(
|
||||
path: ApiEndpoints.addRoom,
|
||||
path: fullPath,
|
||||
body: body,
|
||||
showServerMessage: false,
|
||||
expectedResponseModel: (json) {
|
||||
@ -148,8 +163,8 @@ class HomeCreation {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static Future<Map<String, dynamic>> assignUserToRoom(Map<String, String> body) async {
|
||||
static Future<Map<String, dynamic>> assignUserToRoom(
|
||||
Map<String, String> body) async {
|
||||
try {
|
||||
final response = await _httpService.post(
|
||||
path: ApiEndpoints.addRoomToUser,
|
||||
|
||||
Reference in New Issue
Block a user