Handle case where the filter is manually disabled

This commit is contained in:
Convly 2021-11-12 15:15:41 +01:00
parent bac9e8145e
commit ad8a5e7634

View File

@ -31,8 +31,12 @@ module.exports = ({ strapi }) => {
.hasFiltersEnabeld()
);
const isIDFilterEnabled = extension
.shadowCRUD(contentType.uid)
.field('id')
.hasFiltersEnabeld();
// Add an ID filter to the collection types
if (contentType.kind === 'collectionType') {
if (contentType.kind === 'collectionType' && isIDFilterEnabled) {
t.field('id', { type: getScalarFilterInputTypeName('ID') });
}