Skip to content

Commit

Permalink
refactor(org): change argument from query param to body of request
Browse files Browse the repository at this point in the history
  • Loading branch information
itailevi98 committed Oct 3, 2023
1 parent 87c016e commit 47a1511
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/api/org.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,16 @@ export function createOrgSamlConnectionLink(
return Promise.reject("Invalid orgId")
}

let endpointPath = `${ENDPOINT_PATH}/${orgId}/create_saml_connection_link`
if (expiresInSeconds) {
endpointPath += `?expires_in_seconds=${expiresInSeconds}`
const request = {
expires_in_seconds: expiresInSeconds,
}

return httpRequest(authUrl, integrationApiKey, endpointPath, "POST").then((httpResponse) => {
return httpRequest(
authUrl,
integrationApiKey,
`${ENDPOINT_PATH}/${orgId}/create_saml_connection_link`,
"POST",
JSON.stringify(request)
).then((httpResponse) => {
if (httpResponse.statusCode === 401) {
throw new Error("integrationApiKey is incorrect")
} else if (httpResponse.statusCode === 404) {
Expand Down

0 comments on commit 47a1511

Please sign in to comment.