mirror of
https://github.com/strapi/strapi.git
synced 2025-10-13 00:52:54 +00:00
Merge pull request #612 from strapi/fix-fetch-error-mongoose
Fix fetch error mongoose
This commit is contained in:
commit
832883a91b
@ -28,6 +28,10 @@ module.exports = {
|
||||
*/
|
||||
|
||||
findOne: async (ctx) => {
|
||||
if (!ctx.params._id.match(/^[0-9a-fA-F]{24}$/)) {
|
||||
return ctx.notFound();
|
||||
}
|
||||
|
||||
const data = await strapi.services.<%= id %>.fetch(ctx.params);
|
||||
|
||||
// Send 200 `ok`
|
||||
|
Loading…
x
Reference in New Issue
Block a user