diff --git a/monorepo/actionstep-sandbox/src/endpoints/createActionParticipant.ts b/monorepo/actionstep-sandbox/src/endpoints/createActionParticipant.ts index a761895..a010cd2 100644 --- a/monorepo/actionstep-sandbox/src/endpoints/createActionParticipant.ts +++ b/monorepo/actionstep-sandbox/src/endpoints/createActionParticipant.ts @@ -1,23 +1,28 @@ -import { ActionStepTokenClient, actionStepClient } from '@dbc-tech/actionstep' +import { + ActionStepClient, + ActionStepTokenClient, + actionStepClient, +} from '@dbc-tech/actionstep' export const createActionParticipant = async ( tokenClient: ActionStepTokenClient, ) => { - const { actionParticipants: client } = actionStepClient(tokenClient) + const client: ActionStepClient = actionStepClient(tokenClient) const testActionId = 68330 // or 84407 const testParticipantId = 113702 const testParticipantType = 71 - const { data, error } = await client.createActionParticipant({ - actionparticipants: { - links: { - action: testActionId, - participant: testParticipantId, - participantType: testParticipantType, + const { data, error } = + await client.actionParticipants.createActionParticipant({ + actionparticipants: { + links: { + action: testActionId, + participant: testParticipantId, + participantType: testParticipantType, + }, }, - }, - }) + }) if (error) console.error('error:', error) else { console.log('created action participant:', { diff --git a/monorepo/actionstep/src/action-step-client.ts b/monorepo/actionstep/src/action-step-client.ts index bb07537..3973d40 100644 --- a/monorepo/actionstep/src/action-step-client.ts +++ b/monorepo/actionstep/src/action-step-client.ts @@ -10,3 +10,5 @@ export const actionStepClient = (tokenClient: ActionStepTokenClient) => { participants: participantsClient(tokenClient), } } + +export type ActionStepClient = ReturnType