mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
removed region from create
This commit is contained in:
@ -127,8 +127,7 @@ class SpaceManagementBloc extends Bloc<SpaceManagementEvent, SpaceManagementStat
|
||||
try {
|
||||
CommunityModel? newCommunity = await _api.createCommunity(
|
||||
event.name,
|
||||
event.description,
|
||||
event.regionId,
|
||||
event.description
|
||||
);
|
||||
|
||||
if (newCommunity != null) {
|
||||
|
@ -73,16 +73,14 @@ class UpdateSpacePositionEvent extends SpaceManagementEvent {
|
||||
class CreateCommunityEvent extends SpaceManagementEvent {
|
||||
final String name;
|
||||
final String description;
|
||||
final String regionId;
|
||||
|
||||
const CreateCommunityEvent({
|
||||
required this.name,
|
||||
required this.description,
|
||||
required this.regionId,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object> get props => [name, description, regionId];
|
||||
List<Object> get props => [name, description];
|
||||
}
|
||||
|
||||
class FetchProductsEvent extends SpaceManagementEvent {}
|
||||
|
@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
|
||||
class CreateCommunityDialog extends StatefulWidget {
|
||||
final Function(String name, String description, String regionId)
|
||||
final Function(String name, String description)
|
||||
onCreateCommunity;
|
||||
|
||||
const CreateCommunityDialog({super.key, required this.onCreateCommunity});
|
||||
@ -114,7 +114,6 @@ class CreateCommunityDialogState extends State<CreateCommunityDialog> {
|
||||
widget.onCreateCommunity(
|
||||
enteredName,
|
||||
"",
|
||||
"42dc377a-1a39-4df9-b85a-b3817af88525",
|
||||
);
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
|
@ -59,12 +59,11 @@ class _SidebarWidgetState extends State<SidebarWidget> {
|
||||
showDialog(
|
||||
context: parentContext,
|
||||
builder: (context) => CreateCommunityDialog(
|
||||
onCreateCommunity: (String communityName, String description, String regionId) {
|
||||
onCreateCommunity: (String communityName, String description) {
|
||||
parentContext.read<SpaceManagementBloc>().add(
|
||||
CreateCommunityEvent(
|
||||
name: communityName,
|
||||
description: description,
|
||||
regionId: regionId,
|
||||
),
|
||||
);
|
||||
},
|
||||
|
@ -45,14 +45,13 @@ class CommunitySpaceManagementApi {
|
||||
}
|
||||
}
|
||||
|
||||
Future<CommunityModel?> createCommunity(String name, String description, String regionId) async {
|
||||
Future<CommunityModel?> createCommunity(String name, String description) async {
|
||||
try {
|
||||
final response = await HTTPService().post(
|
||||
path: ApiEndpoints.createCommunity,
|
||||
body: {
|
||||
'name': name,
|
||||
'description': description,
|
||||
'regionId': regionId,
|
||||
},
|
||||
expectedResponseModel: (json) {
|
||||
return CommunityModel.fromJson(json['data']);
|
||||
|
Reference in New Issue
Block a user