use updated model instead of base schemas

This commit is contained in:
Ben Irvin 2023-08-24 13:37:22 +02:00
parent 307122ead0
commit ca2c387811
2 changed files with 4 additions and 4 deletions

View File

@ -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 });

View File

@ -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 });