System Information
- Strapi Version: 4.13.6
- Operating System: mac os
- Database: sqlite
- Node Version: node v18.16.0
- NPM Version:
- Yarn Version:
"use strict";
/**
* thought controller
*/
const { createCoreController } = require("@strapi/strapi").factories;
module.exports = createCoreController("api::thought.thought", ({ strapi }) => ({
async find(ctx, next) {
const userId = ctx.state.user?.id || "";
console.log(userId);
const entries = await strapi.entityService.findMany(
"api::thought.thought",
{
populate: { user: true },
filters: {
user: {
id: userId,
},
},
}
);
ctx.body = entries;
},
}));
I am just getting the query results, I would like to get the paging information.
Also if there is an easier way to do this I would LOVE to know, I could not find am example or anything in the documentation. All I am trying to do is make sure the endpoint only returns documents that the user has created.