I have 3 models :
places
Places.hasMany(models.maintenanceContracts, {
foreignKey: {
name: 'placeIdKey',
field: 'place_id',
},
as: 'maintenanceContracts',
});
maintenanceContracts
MaintenanceContracts.belongsTo(models.maintenanceContractCategories, {
foreignKey: {
name: 'maintenanceContractCategoryIdKey',
field: 'maintenance_contract_category_id',
},
as: 'maintenanceContractCategory',
});
maintenanceContractsCategories
MaintenanceContractCategories.hasMany(models.maintenanceContracts, {
foreignKey: {
name: 'maintenanceContractCategoryIdKey',
field: 'maintenance_contract_category_id',
},
as: 'maintenanceContractCategoryMaintenanceContracts',
});
I’ve created a smart relationship in forest/places
{
field: 'categories',
type: ['String'],
reference: 'maintenanceContractCategories.id'
}
In a nutshell, it is place => maintenanceContracts => maintenanceContractCategories and it works
In Forest Admin I display a place summary view ; i have in related data its categories, for instance :
When I display the category summary view, I find all related maintenanceContracts.
I would like to see the “place where i’m coming from” related maintenanceContracts ONLY, but from this screen I have no idea how I can filter this maintenanceContracts list.
Can you help me for this ?