1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-07 12:30:06 +00:00

fix(*): post request bodies as JSON

This commit is contained in:
Krishna Acondy
2021-01-28 20:36:41 +00:00
parent 3c894c4147
commit 2ea49a425f
3 changed files with 22 additions and 16 deletions

View File

@@ -165,7 +165,7 @@ export class ContextManager {
const { result: context } = await this.requestClient
.post<Context>(
`${this.serverUrl}/compute/contexts`,
JSON.stringify(requestBody),
requestBody,
accessToken
)
.catch((err) => {
@@ -216,7 +216,7 @@ export class ContextManager {
const { result: context } = await this.requestClient
.post<Context>(
`${this.serverUrl}/launcher/contexts`,
JSON.stringify(requestBody),
requestBody,
accessToken
)
.catch((err) => {
@@ -275,11 +275,11 @@ export class ContextManager {
// https://developer.sas.com/apis/rest/Compute/#update-a-context-definition
return await this.requestClient.put<Context>(
`/compute/contexts/${context.id}`,
JSON.stringify({
{
...context,
...editedContext,
attributes: { ...context.attributes, ...editedContext.attributes }
}),
},
accessToken,
{ 'If-Match': etag }
)