mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
feat: update ApiRequest to accept POST w/o payloads
This commit is contained in:
parent
9a0226d158
commit
65da8a845a
@ -31,6 +31,13 @@ POST.args = {
|
|||||||
title: 'Create a feature toggle with impression data enabled. (example)',
|
title: 'Create a feature toggle with impression data enabled. (example)',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const POSTWithoutPayload = Template.bind({});
|
||||||
|
POSTWithoutPayload.args = {
|
||||||
|
verb: 'post',
|
||||||
|
url: 'api/admin/projects/<projectId>/features/<featureName>/environments/<environment>/on',
|
||||||
|
title: 'Disable a toggle in an env.',
|
||||||
|
};
|
||||||
|
|
||||||
export const PUT = Template.bind({});
|
export const PUT = Template.bind({});
|
||||||
PUT.args = {
|
PUT.args = {
|
||||||
verb: 'put',
|
verb: 'put',
|
||||||
|
@ -68,6 +68,9 @@ curl -H "Content-Type: application/json" \\
|
|||||||
<${baseUrl}>/${url}`
|
<${baseUrl}>/${url}`
|
||||||
).trim();
|
).trim();
|
||||||
|
|
||||||
|
const httpieBlockFormatSpecifier =
|
||||||
|
verbUpper === 'POST' && !prettyPayload ? '--json' : '';
|
||||||
|
|
||||||
const httpieBlock = (
|
const httpieBlock = (
|
||||||
payload
|
payload
|
||||||
? `echo '${prettyPayload}' \\
|
? `echo '${prettyPayload}' \\
|
||||||
@ -77,7 +80,8 @@ curl -H "Content-Type: application/json" \\
|
|||||||
: `
|
: `
|
||||||
http ${verbUpper} \\
|
http ${verbUpper} \\
|
||||||
<${baseUrl}>/${url} \\
|
<${baseUrl}>/${url} \\
|
||||||
Authorization:<${authToken}>`.trim()
|
Authorization:<${authToken}> \\
|
||||||
|
${httpieBlockFormatSpecifier}`.trim()
|
||||||
).trim();
|
).trim();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user