Skip to content

Commit 58ec6d1

Browse files
committedDec 7, 2023
fix: REST getForm returns a flattened shape of the form compared to GraphQL
1 parent 0c28feb commit 58ec6d1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎packages/tasklist-client-node-js/src/__test__/restclient.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ describe('TasklistRESTClient', () => {
8585
expect(task.id).toBe(id)
8686
})
8787

88-
it('can retrieve an embedded form', async () => {
88+
it.only('can retrieve an embedded form', async () => {
8989
const tasklist = new TasklistRESTClient()
9090
const res = await tasklist.getForm('userTaskForm_3r97fja', def.processes[0].processDefinitionKey)
91-
expect(res.form.id).toBe('userTaskForm_3r97fja')
91+
expect(res.id).toBe('userTaskForm_3r97fja')
9292
})
9393

9494
it('can claim a task', async () => {

‎packages/tasklist-client-node-js/src/lib/TasklistRESTClient.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export class TasklistRESTClient {
108108
* @param formId
109109
* @param processDefinitionKey
110110
*/
111-
public async getForm(formId: string, processDefinitionKey: string): Promise<{ form: Form }> {
111+
public async getForm(formId: string, processDefinitionKey: string): Promise<Form> {
112112
const headers = await this.getHeaders()
113113
return this.rest
114114
.get(`forms/${formId}`, {

0 commit comments

Comments
 (0)
Please sign in to comment.