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
Update services.md #7999
Update services.md #7999
Conversation
Added entityValidator to create and update service, so it act like the default service and doesn't throw a 500 Error on invalid data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this update. I actually think we should link to the reference implementation in the code directly @derrickmehaffy @lauriejim what do you think ?
Codecov Report
@@ Coverage Diff @@
## documentation #7999 +/- ##
==================================================
+ Coverage 19.14% 32.71% +13.57%
==================================================
Files 855 1194 +339
Lines 11933 12965 +1032
Branches 1898 1279 -619
==================================================
+ Hits 2284 4241 +1957
+ Misses 8100 7884 -216
+ Partials 1549 840 -709
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
I agree @alexandrebodin (as I wasn't even aware that function existed :P I thought it was handled at the query level) |
I updated the code so it looks more like the strapi internal implementation. https://github.com/strapi/strapi/blob/master/packages/strapi/lib/services/entity-service.js#L65
I've updated the code so it's more in line with the actual implementation |
We should be sure to add this to the migration guide as well for 3.2.0 to make it easier to find and let people know to update their services. |
@derrickmehaffy this was introduced a while back so I don't think that should go in the next migration guide :) |
Aye but no one was aware and we are changing the docs to add it in for overriding the core controllers > hence the migration guide. I've helped a lot of people write their their own overrides and none are using that function ;p |
I think the only thing we should do is use a tool to embed the code directly from github or something. this would always be up to date this way |
Added entityValidator to create and update service, so it act like the default service and doesn't throw a 500 Error on invalid data.