1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-15 08:00:05 +00:00

feat(create-context): add the ability to modify attributes

This commit is contained in:
Krishna Acondy
2020-09-10 10:02:55 +01:00
parent f69a635e1d
commit b2f6d4e6d1
2 changed files with 7 additions and 1 deletions

View File

@@ -323,7 +323,11 @@ export class SASViyaApiClient {
const updateContextRequest: RequestInit = { const updateContextRequest: RequestInit = {
method: 'PUT', method: 'PUT',
headers, headers,
body: JSON.stringify({ ...context, ...updatedContext }) body: JSON.stringify({
...context,
...updatedContext,
attributes: { ...context.attributes, ...updatedContext.attributes }
})
} }
return await this.request<Context>( return await this.request<Context>(

View File

@@ -3,6 +3,7 @@ export interface Context {
id: string id: string
createdBy: string createdBy: string
version: number version: number
attributes?: any
} }
export interface EditContextInput { export interface EditContextInput {
@@ -10,6 +11,7 @@ export interface EditContextInput {
description?: string description?: string
launchContext?: { name: string } launchContext?: { name: string }
environment?: { options?: string[]; autoExecLines?: string[] } environment?: { options?: string[]; autoExecLines?: string[] }
attributes?: any
authorizedUsers?: string[] authorizedUsers?: string[]
authorizeAllAuthenticatedUsers?: boolean authorizeAllAuthenticatedUsers?: boolean
} }