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.
12 lines
290 B
TypeScript
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;
|
|
};
|