mirror of
https://github.com/strapi/strapi.git
synced 2025-10-27 16:10:08 +00:00
remove search admin route for upload plugin
This commit is contained in:
parent
0f123ceb39
commit
6fe8c51df2
@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
const { contentTypes: contentTypesUtils, sanitizeEntity } = require('@strapi/utils');
|
const { contentTypes: contentTypesUtils } = require('@strapi/utils');
|
||||||
const { getService } = require('../utils');
|
const { getService } = require('../utils');
|
||||||
const validateSettings = require('./validation/settings');
|
const validateSettings = require('./validation/settings');
|
||||||
const validateUploadBody = require('./validation/upload');
|
const validateUploadBody = require('./validation/upload');
|
||||||
@ -205,18 +205,6 @@ module.exports = {
|
|||||||
|
|
||||||
await (id ? this.replaceFile : this.uploadFiles)(ctx);
|
await (id ? this.replaceFile : this.uploadFiles)(ctx);
|
||||||
},
|
},
|
||||||
|
|
||||||
async search(ctx) {
|
|
||||||
const { id } = ctx.params;
|
|
||||||
const model = strapi.getModel('plugin::upload.file');
|
|
||||||
const entries = await strapi.query('plugin::upload.file').findMany({
|
|
||||||
where: {
|
|
||||||
$or: [{ hash: { $contains: id } }, { name: { $contains: id } }],
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
ctx.body = sanitizeEntity(entries, { model });
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const findEntityAndCheckPermissions = async (ability, action, model, id) => {
|
const findEntityAndCheckPermissions = async (ability, action, model, id) => {
|
||||||
|
|||||||
@ -91,14 +91,6 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
method: 'GET',
|
|
||||||
path: '/search/:id',
|
|
||||||
handler: 'admin-api.search',
|
|
||||||
config: {
|
|
||||||
policies: ['admin::isAuthenticatedAdmin'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
path: '/files/:id',
|
path: '/files/:id',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user