'use strict'; /** * Read the documentation (https://strapi.io/documentation/v3.x/concepts/controllers.html#core-controllers) * to customize this controller */ module.exports = { async find(ctx) { let entities; const {user} = ctx.state; const {query} = ctx; query["teacher_eq"] = user.id; if (query._q) { entities = await strapi.services["session-resource"].search(query); } else { entities = await strapi.services["session-resource"].find(query); } } };