This is my schema.json code :
{
"kind": "collectionType",
"collectionName": "user_planner_v2s",
"info": {
"singularName": "user-planner-v2",
"pluralName": "user-planner-v2s",
"displayName": "UserPlannerV2",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"planBlock": {
"displayName": "planBlock",
"type": "component",
"repeatable": true,
"component": "user-planner.plan-block"
}
}
}
and this is my planBlock component json structure :
{
“collectionName”: “components_user_planner_plan_blocks”,
“info”: {
“displayName”: “planBlock”,
“icon”: “collapse”
},
“options”: {},
“attributes”: {
“plans”: {
“type”: “component”,
“repeatable”: false,
“component”: “user-planner.plans”
},
“date”: {
“type”: “date”
}
}
}
I am trying to filter according to the date ,tried creating controller and filtering but it didn’t worked
const programs = await strapi.entityService.findMany(
"api::user-planner-v2.user-planner-v2",
{
filters: {
userCategory: {
$eq: user.category,
},
planBlock: {
date: {
$eq: date
}
}
},
populate: {
planBlock: {
populate: {
plans: {
populate: {
train_pages: {
populate: {
image: true,
equipment:true,
author: true
},
},
eat_detail_pages: {
populate: {
image: true,
chef:true
},
},
meditation_pages: {
populate: {
image: true,
author: true
},
},
},
},
},
},
headers: true,
},
}
);
Please give me any suggestion what can I do . I cannot bring the date field out from the planBlock and it also it is repeatable component .
Thankyou