Skip to content

Commit 3f762c9

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(selectors): preserve hydrated HubSpot owner IDs
1 parent 61b0581 commit 3f762c9

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎apps/sim/lib/selectors/server/providers/hubspot.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,13 @@ describe('HubSpot server selector adapter', () => {
170170

171171
await expect(
172172
hubspotSelectorAttachments['hubspot.owners'].execute(
173-
args({ kind: 'detail', id: '777' }, 'hubspot.owners')
173+
args({ kind: 'detail', id: '000777' }, 'hubspot.owners')
174174
)
175175
).resolves.toEqual({
176176
kind: 'detail',
177-
item: { id: '777', label: 'Katherine Johnson' },
177+
item: { id: '000777', label: 'Katherine Johnson' },
178178
})
179-
expect(String(mockFetch.mock.calls[0]?.[0])).toBe('https://api.hubapi.com/crm/v3/owners/777')
179+
expect(String(mockFetch.mock.calls[0]?.[0])).toBe('https://api.hubapi.com/crm/v3/owners/000777')
180180
expect(mockFetch).toHaveBeenCalledTimes(1)
181181
})
182182
})

‎apps/sim/lib/selectors/server/providers/hubspot.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,9 @@ async function executeOwners(args: ExecuteServerSelectorArgs) {
220220
signal: args.signal,
221221
}
222222
)
223-
return detailSelectorResult(owner.archived || !owner.id ? null : hubspotOwnerOption(owner))
223+
return detailSelectorResult(
224+
owner.archived || !owner.id ? null : { ...hubspotOwnerOption(owner), id: ownerId }
225+
)
224226
}
225227

226228
requireListRequest(args.selectorKey, args.request)

0 commit comments

Comments
 (0)