mirror of
https://github.com/strapi/strapi.git
synced 2026-01-07 12:45:45 +00:00
use updated model instead of base schemas
This commit is contained in:
parent
307122ead0
commit
ca2c387811
@ -10,13 +10,13 @@ const { sanitize } = utils;
|
||||
const { ValidationError } = utils.errors;
|
||||
|
||||
const sanitizeOutput = (data, ctx) => {
|
||||
const schema = strapi.getModel(FILE_MODEL_UID);
|
||||
const schema = strapi.contentType(FILE_MODEL_UID);
|
||||
const { auth } = ctx.state;
|
||||
|
||||
return sanitize.contentAPI.output(data, schema, { auth });
|
||||
};
|
||||
const sanitizeQuery = (data, ctx) => {
|
||||
const schema = strapi.getModel(FILE_MODEL_UID);
|
||||
const schema = strapi.contentType(FILE_MODEL_UID);
|
||||
const { auth } = ctx.state;
|
||||
|
||||
return sanitize.contentAPI.query(data, schema, { auth });
|
||||
|
||||
@ -15,14 +15,14 @@ const { sanitize } = utils;
|
||||
const { ApplicationError, ValidationError, NotFoundError } = utils.errors;
|
||||
|
||||
const sanitizeOutput = async (user, ctx) => {
|
||||
const schema = strapi.getModel('plugin::users-permissions.user');
|
||||
const schema = strapi.contentType('plugin::users-permissions.user');
|
||||
const { auth } = ctx.state;
|
||||
|
||||
return sanitize.contentAPI.output(user, schema, { auth });
|
||||
};
|
||||
|
||||
const sanitizeQuery = async (query, ctx) => {
|
||||
const schema = strapi.getModel('plugin::users-permissions.user');
|
||||
const schema = strapi.contentType('plugin::users-permissions.user');
|
||||
const { auth } = ctx.state;
|
||||
|
||||
return sanitize.contentAPI.query(query, schema, { auth });
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user