As for me I have to specify the request data before sending it
Not working
const profile = await strapi.db.query("api::profile.profile").findOne({
where: {
user: ctx.state.user,
},
select: ["id"],
});
Works fine
const profile = await strapi.db.query("api::profile.profile").findOne({
where: {
user: {
id: ctx.state.user.id,
}
},
select: ["id"],
});