Merge pull request #19144 from strapi/fix/undefined-controller-in-startup-telemetry

This commit is contained in:
Jean-Sébastien Herbaux 2024-01-03 16:13:33 +01:00 committed by GitHub
commit a99ed82a44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -381,7 +381,8 @@ class Strapi implements StrapiI {
numberOfComponents: _.size(this.components),
numberOfDynamicZones: getNumberOfDynamicZones(),
numberOfCustomControllers: Object.values<Common.Controller>(this.controllers).filter(
factories.isCustomController
// TODO: Fix this at the content API loader level to prevent future types issues
(controller) => controller !== undefined && factories.isCustomController(controller)
).length,
environment: this.config.environment,
// TODO: to add back

View File

@ -43,8 +43,8 @@ const createCoreController = <
Object.setPrototypeOf(userCtrl, baseController);
const isCustomController = typeof cfg !== 'undefined';
if (isCustomController) {
const isCustom = typeof cfg !== 'undefined';
if (isCustom) {
Object.defineProperty(userCtrl, symbols.CustomController, {
writable: false,
configurable: false,