From 1a967e2ba04a2d52c8e85975a2c8774bba133e05 Mon Sep 17 00:00:00 2001 From: hannathkadher Date: Fri, 22 Nov 2024 00:29:35 +0400 Subject: [PATCH] removed region from create --- lib/pages/spaces_management/bloc/space_management_bloc.dart | 3 +-- lib/pages/spaces_management/bloc/space_management_event.dart | 4 +--- .../widgets/dialogs/create_community_dialog.dart | 3 +-- lib/pages/spaces_management/widgets/sidebar_widget.dart | 3 +-- lib/services/space_mana_api.dart | 3 +-- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/lib/pages/spaces_management/bloc/space_management_bloc.dart b/lib/pages/spaces_management/bloc/space_management_bloc.dart index 401a960a..913c4c92 100644 --- a/lib/pages/spaces_management/bloc/space_management_bloc.dart +++ b/lib/pages/spaces_management/bloc/space_management_bloc.dart @@ -127,8 +127,7 @@ class SpaceManagementBloc extends Bloc get props => [name, description, regionId]; + List get props => [name, description]; } class FetchProductsEvent extends SpaceManagementEvent {} diff --git a/lib/pages/spaces_management/widgets/dialogs/create_community_dialog.dart b/lib/pages/spaces_management/widgets/dialogs/create_community_dialog.dart index a02ea572..f875f5ef 100644 --- a/lib/pages/spaces_management/widgets/dialogs/create_community_dialog.dart +++ b/lib/pages/spaces_management/widgets/dialogs/create_community_dialog.dart @@ -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 { widget.onCreateCommunity( enteredName, "", - "42dc377a-1a39-4df9-b85a-b3817af88525", ); Navigator.of(context).pop(); } diff --git a/lib/pages/spaces_management/widgets/sidebar_widget.dart b/lib/pages/spaces_management/widgets/sidebar_widget.dart index 25da7d04..94817e75 100644 --- a/lib/pages/spaces_management/widgets/sidebar_widget.dart +++ b/lib/pages/spaces_management/widgets/sidebar_widget.dart @@ -59,12 +59,11 @@ class _SidebarWidgetState extends State { showDialog( context: parentContext, builder: (context) => CreateCommunityDialog( - onCreateCommunity: (String communityName, String description, String regionId) { + onCreateCommunity: (String communityName, String description) { parentContext.read().add( CreateCommunityEvent( name: communityName, description: description, - regionId: regionId, ), ); }, diff --git a/lib/services/space_mana_api.dart b/lib/services/space_mana_api.dart index 07b98f10..01248262 100644 --- a/lib/services/space_mana_api.dart +++ b/lib/services/space_mana_api.dart @@ -45,14 +45,13 @@ class CommunitySpaceManagementApi { } } - Future createCommunity(String name, String description, String regionId) async { + Future 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']);