twenty
twenty copied to clipboard
REST API - Cannot filter using a relation if they are 2 fields pointing to the same object
Bug Description
Discord thread here
We were waiting for the release today but this did not solve the pb despite the PRs on relations.
I was able to reproduce on their workspace and ours.
- Assume we have 2 fields from the people object pointing to the company object. with a "Belongs to one"
- fields are company and company2 (just an example)
- now assume we have a person record with company = airbnb and company2 = uber (aka pointing to 2 different companies).
- when filtering the find many people on the playground for the rest API, using the companyId, we get the expected result.
- when filtering the find many people on the playground using the company2Id, I get the following error msg
{ "statusCode": 400, "error": "BadRequestException", "messages": [ "field 'company2Id' does not exist in '_people' object" ] }
Example: can be done on 20 for 20 or impersonating the customer (using Discord or pinging me ).
Additional data point: on their self hosting instance, they could not filter using neither of the 2 fields, getting the same error msg.
critical given they have a customer demo on Thursday, East Asia timeline.