Set hook on relations

How can I set a hook on relations?
I need to do sth after adding/linking a relation record.
I found addHook for collections but I couldn’t find anything which does the same for relations.

Hello @bond,

Thanks for your message :raised_hands:

Could you please tell us a bit more on the context of this request?
On what agent name and version are you working on?
Could you please give us your project name as well?

Thank you.

Hello,
Thank you for your attention.
Currently, we are using the forestadmin’s JS SDK@1.0.0-beta.55 on top of the NestJS framework.
The project name is “Bond”.

Hey @bond

addHook should work in your case if you set the hook the on targeted relation model.

You could also use replaceFieldWriting but we highly suggest to rely on hooks for those kind of feature.

Again, if you could share a use-case (either here or via DM if you consider it private), maybe we can be a bit more specific on how to implement such use-case.