mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 19:04:38 +00:00
Sanitize /upload/search/:q route (#8658)
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
This commit is contained in:
parent
d3c249c876
commit
4a33829f11
@ -8,6 +8,7 @@
|
||||
const _ = require('lodash');
|
||||
const apiUploadController = require('./upload/api');
|
||||
const adminUploadController = require('./upload/admin');
|
||||
const { sanitizeEntity } = require('strapi-utils');
|
||||
|
||||
const resolveController = ctx => {
|
||||
const {
|
||||
@ -66,10 +67,12 @@ module.exports = {
|
||||
|
||||
async search(ctx) {
|
||||
const { id } = ctx.params;
|
||||
|
||||
ctx.body = await strapi.query('file', 'upload').custom(searchQueries)({
|
||||
const model = strapi.getModel('file', 'upload');
|
||||
const entries = await strapi.query('file', 'upload').custom(searchQueries)({
|
||||
id,
|
||||
});
|
||||
|
||||
ctx.body = sanitizeEntity(entries, { model });
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user