Skip to content

Commit 634ffca

Browse files
committed
GET->POST cleanup for #178
1 parent 00dc5a0 commit 634ffca

File tree

1 file changed

+2
-23
lines changed

1 file changed

+2
-23
lines changed

lib/screens/home_page/editor_pane/details_card/request_pane/request_body.dart

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,6 @@ class EditRequestBody extends ConsumerWidget {
2121
final apiType = ref
2222
.watch(selectedRequestModelProvider.select((value) => value?.apiType));
2323

24-
// TODO: #178 GET->POST Currently switches to POST everytime user edits body even if the user intentionally chooses GET
25-
// final sm = ScaffoldMessenger.of(context);
26-
// void changeToPostMethod() {
27-
// if (requestModel?.httpRequestModel!.method == HTTPVerb.get) {
28-
// ref
29-
// .read(collectionStateNotifierProvider.notifier)
30-
// .update(selectedId, method: HTTPVerb.post);
31-
// sm.hideCurrentSnackBar();
32-
// sm.showSnackBar(getSnackBar(
33-
// "Switched to POST method",
34-
// small: false,
35-
// ));
36-
// }
37-
// }
38-
3924
return Column(
4025
children: [
4126
(apiType == APIType.rest)
@@ -55,12 +40,8 @@ class EditRequestBody extends ConsumerWidget {
5540
switch (apiType) {
5641
APIType.rest => Expanded(
5742
child: switch (contentType) {
58-
ContentType.formdata => const Padding(
59-
padding: kPh4,
60-
child: FormDataWidget(
61-
// TODO: See changeToPostMethod above
62-
// changeMethodToPost: changeToPostMethod,
63-
)),
43+
ContentType.formdata =>
44+
const Padding(padding: kPh4, child: FormDataWidget()),
6445
// TODO: Fix JsonTextFieldEditor & plug it here
6546
ContentType.json => Padding(
6647
padding: kPt5o10,
@@ -69,7 +50,6 @@ class EditRequestBody extends ConsumerWidget {
6950
fieldKey: "$selectedId-json-body-editor",
7051
initialValue: requestModel?.httpRequestModel?.body,
7152
onChanged: (String value) {
72-
// changeToPostMethod();
7353
ref
7454
.read(collectionStateNotifierProvider.notifier)
7555
.update(body: value);
@@ -84,7 +64,6 @@ class EditRequestBody extends ConsumerWidget {
8464
fieldKey: "$selectedId-body-editor",
8565
initialValue: requestModel?.httpRequestModel?.body,
8666
onChanged: (String value) {
87-
// changeToPostMethod();
8867
ref
8968
.read(collectionStateNotifierProvider.notifier)
9069
.update(body: value);

0 commit comments

Comments
 (0)