mirror of
https://github.com/foss42/apidash.git
synced 2025-12-01 18:28:25 +08:00
GET->POST cleanup for #178
This commit is contained in:
@@ -21,21 +21,6 @@ class EditRequestBody extends ConsumerWidget {
|
|||||||
final apiType = ref
|
final apiType = ref
|
||||||
.watch(selectedRequestModelProvider.select((value) => value?.apiType));
|
.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(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
(apiType == APIType.rest)
|
(apiType == APIType.rest)
|
||||||
@@ -55,12 +40,8 @@ class EditRequestBody extends ConsumerWidget {
|
|||||||
switch (apiType) {
|
switch (apiType) {
|
||||||
APIType.rest => Expanded(
|
APIType.rest => Expanded(
|
||||||
child: switch (contentType) {
|
child: switch (contentType) {
|
||||||
ContentType.formdata => const Padding(
|
ContentType.formdata =>
|
||||||
padding: kPh4,
|
const Padding(padding: kPh4, child: FormDataWidget()),
|
||||||
child: FormDataWidget(
|
|
||||||
// TODO: See changeToPostMethod above
|
|
||||||
// changeMethodToPost: changeToPostMethod,
|
|
||||||
)),
|
|
||||||
// TODO: Fix JsonTextFieldEditor & plug it here
|
// TODO: Fix JsonTextFieldEditor & plug it here
|
||||||
ContentType.json => Padding(
|
ContentType.json => Padding(
|
||||||
padding: kPt5o10,
|
padding: kPt5o10,
|
||||||
@@ -69,7 +50,6 @@ class EditRequestBody extends ConsumerWidget {
|
|||||||
fieldKey: "$selectedId-json-body-editor",
|
fieldKey: "$selectedId-json-body-editor",
|
||||||
initialValue: requestModel?.httpRequestModel?.body,
|
initialValue: requestModel?.httpRequestModel?.body,
|
||||||
onChanged: (String value) {
|
onChanged: (String value) {
|
||||||
// changeToPostMethod();
|
|
||||||
ref
|
ref
|
||||||
.read(collectionStateNotifierProvider.notifier)
|
.read(collectionStateNotifierProvider.notifier)
|
||||||
.update(body: value);
|
.update(body: value);
|
||||||
@@ -84,7 +64,6 @@ class EditRequestBody extends ConsumerWidget {
|
|||||||
fieldKey: "$selectedId-body-editor",
|
fieldKey: "$selectedId-body-editor",
|
||||||
initialValue: requestModel?.httpRequestModel?.body,
|
initialValue: requestModel?.httpRequestModel?.body,
|
||||||
onChanged: (String value) {
|
onChanged: (String value) {
|
||||||
// changeToPostMethod();
|
|
||||||
ref
|
ref
|
||||||
.read(collectionStateNotifierProvider.notifier)
|
.read(collectionStateNotifierProvider.notifier)
|
||||||
.update(body: value);
|
.update(body: value);
|
||||||
|
|||||||
Reference in New Issue
Block a user