V4.0.0 Sanitize user data

The following code is working fine with Strapi v4.0.5:

async findOne(ctx) 
{
	const { id } = ctx.params;
	const { query } = ctx;
	const entity = await strapi.service('api::customer.customer').findOne(id, query);
	const sanitizedEntity = await this.sanitizeOutput(entity, ctx);
	return this.transformResponse(sanitizedEntity);
}
1 Like