TypeORM hooks before save with access to the repository

3.6k views Asked by At

Does anyone have a smart solution to check if the user is allowed to change the entity values. Something like a hook before .save()? The default entity hooks do not have access to the repo. I want the user to be able to update an entity only if the userid matches.

Thanks in advance :)

0

There are 0 answers