From b2f6d4e6d1d96e1f23b3040553cd9f15b2dc2a52 Mon Sep 17 00:00:00 2001 From: Krishna Acondy Date: Thu, 10 Sep 2020 10:02:55 +0100 Subject: [PATCH] feat(create-context): add the ability to modify attributes --- src/SASViyaApiClient.ts | 6 +++++- src/types/Context.ts | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/SASViyaApiClient.ts b/src/SASViyaApiClient.ts index 6f597c5..bb8d00c 100644 --- a/src/SASViyaApiClient.ts +++ b/src/SASViyaApiClient.ts @@ -323,7 +323,11 @@ export class SASViyaApiClient { const updateContextRequest: RequestInit = { method: 'PUT', headers, - body: JSON.stringify({ ...context, ...updatedContext }) + body: JSON.stringify({ + ...context, + ...updatedContext, + attributes: { ...context.attributes, ...updatedContext.attributes } + }) } return await this.request( diff --git a/src/types/Context.ts b/src/types/Context.ts index baa1da0..26e942c 100644 --- a/src/types/Context.ts +++ b/src/types/Context.ts @@ -3,6 +3,7 @@ export interface Context { id: string createdBy: string version: number + attributes?: any } export interface EditContextInput { @@ -10,6 +11,7 @@ export interface EditContextInput { description?: string launchContext?: { name: string } environment?: { options?: string[]; autoExecLines?: string[] } + attributes?: any authorizedUsers?: string[] authorizeAllAuthenticatedUsers?: boolean }