-
Notifications
You must be signed in to change notification settings - Fork 48
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
Modifications from $beforeUpdate and $beforeInsert not being returned in UPDATE #133
Comments
Is it this? feathers-objection/src/index.js Line 779 in 03e4b8e
But then we select the appropriate columns from the original feathers-objection/src/index.js Line 782 in 03e4b8e
|
@avimar If you think this behavior should be changed, you can always open a PR with a short description to explain its need. |
I would call this a bug:
I'd expect that you can simply the results after the model has been applied the Suggestions? |
I just started trying objection's virtual attributes - and it seems we have the same issue: those properties also don't show up in the returned object. |
@avimar, Please check the following issues regarding model's virtual attributes that do not return in the response: |
It's not 45, I have the latest version. What's weird is that when I do a GET, it shows the virtual attributes. It's on UPDATE that it doesn't show. I checked, and it shows on PATCH. My guess is that these are both related -- we somehow have pre-model data: the old beforeUpdate data and similarly missing the virtual attributes. |
The auto-generated models include:
It seems to work and update the entry in the database.
But when I look at the response data from Feathers (e.g. on an update), it's returning the same
updatedAt
as is being submitted.The same with other fields that I'm modifying.
In other words, feathers-objection is properly honoring
beforeUpdate
for the database calls, but it's not being returned to the client, the client is just getting back his own data unfixed.I would expect that these modifications from within the model should be pushed back to the response.
Relevant Versions, all latest:
"@feathersjs/express": "^4.5.10",
"@feathersjs/feathers": "^4.5.10",
"@feathersjs/transport-commons": "^4.5.10",
"feathers-objection": "^7.0.0",
"knex": "^0.21.12",
"objection": "^2.2.3",
"pg": "^8.5.1",
The text was updated successfully, but these errors were encountered: