mirror of
https://github.com/foss42/apidash.git
synced 2025-12-01 10:17:47 +08:00
GET->POST cleanup for #178
This commit is contained in:
@@ -21,21 +21,6 @@ class EditRequestBody extends ConsumerWidget {
|
||||
final apiType = ref
|
||||
.watch(selectedRequestModelProvider.select((value) => value?.apiType));
|
||||
|
||||
// TODO: #178 GET->POST Currently switches to POST everytime user edits body even if the user intentionally chooses GET
|
||||
// final sm = ScaffoldMessenger.of(context);
|
||||
// void changeToPostMethod() {
|
||||
// if (requestModel?.httpRequestModel!.method == HTTPVerb.get) {
|
||||
// ref
|
||||
// .read(collectionStateNotifierProvider.notifier)
|
||||
// .update(selectedId, method: HTTPVerb.post);
|
||||
// sm.hideCurrentSnackBar();
|
||||
// sm.showSnackBar(getSnackBar(
|
||||
// "Switched to POST method",
|
||||
// small: false,
|
||||
// ));
|
||||
// }
|
||||
// }
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
(apiType == APIType.rest)
|
||||
@@ -55,12 +40,8 @@ class EditRequestBody extends ConsumerWidget {
|
||||
switch (apiType) {
|
||||
APIType.rest => Expanded(
|
||||
child: switch (contentType) {
|
||||
ContentType.formdata => const Padding(
|
||||
padding: kPh4,
|
||||
child: FormDataWidget(
|
||||
// TODO: See changeToPostMethod above
|
||||
// changeMethodToPost: changeToPostMethod,
|
||||
)),
|
||||
ContentType.formdata =>
|
||||
const Padding(padding: kPh4, child: FormDataWidget()),
|
||||
// TODO: Fix JsonTextFieldEditor & plug it here
|
||||
ContentType.json => Padding(
|
||||
padding: kPt5o10,
|
||||
@@ -69,7 +50,6 @@ class EditRequestBody extends ConsumerWidget {
|
||||
fieldKey: "$selectedId-json-body-editor",
|
||||
initialValue: requestModel?.httpRequestModel?.body,
|
||||
onChanged: (String value) {
|
||||
// changeToPostMethod();
|
||||
ref
|
||||
.read(collectionStateNotifierProvider.notifier)
|
||||
.update(body: value);
|
||||
@@ -84,7 +64,6 @@ class EditRequestBody extends ConsumerWidget {
|
||||
fieldKey: "$selectedId-body-editor",
|
||||
initialValue: requestModel?.httpRequestModel?.body,
|
||||
onChanged: (String value) {
|
||||
// changeToPostMethod();
|
||||
ref
|
||||
.read(collectionStateNotifierProvider.notifier)
|
||||
.update(body: value);
|
||||
|
||||
Reference in New Issue
Block a user