Skip to content
Discussion options

You must be logged in to vote

@dawidmachon you're right in that if the operation is create, there is not yet an ID to use. Your solution looks fine to me, does it work? Just to sum it up:

  1. Before a user is created, create a bank account and attach the bankAccountId to the user
  2. After a user is created, lookup their bank account and update the owner with their userId

This will work for that initial connection but updates on either end of the relationship will also need to be wired in—and this may lead to infinite loops. There are ways around this, like maintaining a hidden skipHooks field on the collection, I've done something similar to this in our Stripe plugin. Others have run into this same need, though, and there'…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dawidmachon
Comment options

Answer selected by dawidmachon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants