Skip to content

Commit

Permalink
ActionStepClient type
Browse files Browse the repository at this point in the history
  • Loading branch information
nad-au committed Mar 11, 2024
1 parent c00a6f1 commit 5ca7c40
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -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:', {
Expand Down
2 changes: 2 additions & 0 deletions monorepo/actionstep/src/action-step-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ export const actionStepClient = (tokenClient: ActionStepTokenClient) => {
participants: participantsClient(tokenClient),
}
}

export type ActionStepClient = ReturnType<typeof actionStepClient>

0 comments on commit 5ca7c40

Please sign in to comment.