PromucFlow_constructor/app/client/src/selectors/apiPaneSelectors.ts
Ayangade Adeoluwa be685ef815
Prevent content-type header from changing when switching to raw mode in API pane (#11326)
This commit fixes post body type switcher in API editor. Prior to this PR,
switching the post body to Raw changes the content-type to "text/plain", This
fixes that by preserving the previous content-type when user switches to raw or
none body type. It also gives users the flexibility to use any non supported
content type, while in Raw body mode.
2022-02-22 16:32:43 +05:30

12 lines
290 B
TypeScript

import { AppState } from "reducers";
type GetFormData = (
state: AppState,
apiId: string,
) => { label: string; value: string };
export const getDisplayFormat: GetFormData = (state, apiId) => {
const displayFormat = state.ui.apiPane.extraformData[apiId];
return displayFormat;
};