Unable to update by companyId with `client.companies.update`
mattvpham opened this issue · 0 comments
mattvpham commented
Version info
- intercom-node version: 4.0.0
- Node version: v18.13.0
Expected behavior
In the client.companies.create
call, I provide a companyId
field that is the company id that I have defined for the company, so I expect the companyId
field in client.companies.update
to correspond with that same company id.
Actual behavior
It fails to update and throws a 404 Company Not Found
error.
Steps to reproduce
- Create a company with an arbitrary company id
await client.companies.create({
companyId: 'abcdefg', // all good
name: 'TestCompany',
createdAt: Math.floor((new Date()).getTime() / 1000),
monthlySpend: 0,
industry: '',
plan: '',
size: 0,
website: '',
customAttributes: {}
})
- Attempt to update that company using the same company id
await client.companies.update({
companyId: 'abcdefg', // <-- it's actually expecting intercomId here
name: 'TestCompany',
createdAt: Math.floor((new Date()).getTime() / 1000),
monthlySpend: 0,
industry: '',
plan: '',
size: 0,
website: '',
customAttributes: {}
})