I need to customize GET and PUT request for the field in Edition view.
For example I have two entities in my app: 'Companies' api/v1/companies
and 'Journals' api/v1/journals
.
In Edition view for 'Journals' api/v1/journals/1/edit
one of the field should be a composite, based on crossing of entities api/v1/journals/1/companies?companyType=client
. Gets companies of the specified type related to the specified journal
This request responce is array of objects
[{"id":3,"name":"Hardworking Monkeys","type":"client"},
{"id":5,"name":"Other Monkeys","type":"client"}]
This field is a "reference_many" field.
And PUT request for this field api/v1/journals/{journalId}/companies?companyType=
should PUT array with IDs of the companies
So, the question is: Is it possible to realize such logic?