Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] @updatedValue/@updatedBy #1666

Open
Tsimopak opened this issue Aug 28, 2024 · 1 comment
Open

[Feature Request] @updatedValue/@updatedBy #1666

Tsimopak opened this issue Aug 28, 2024 · 1 comment

Comments

@Tsimopak
Copy link

Is your feature request related to a problem? Please describe.
The most common place to use is when trying to update the updatedByUser field, which in that case we would probably want to use the value of auth().id

Describe the solution you'd like
I'm not sure about the syntax but maybe a new operator @updatedBy or @updatedValue that can look like that: @updatedBy/@updatedValue(auth().id)

Describe alternatives you've considered

  1. You can deliever the user id in frontend, but it's not secured and redundant.

  2. In case of using automatic server CRUD using RPCHandler/RestAPIHandler, it's very hard to think about alternative, one of them is to check the body query sent from user, and check if the schema we are about to update has fixed keywords like createdByUser, and if so, to inject to the query (based on the protocol - rpc/rest api) also the createdByUser - this should work but a bit hard to implement and also prone to mistakes in case you change the attributes of your model

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@Tsimopak and others