Is NavigationLoadedEvent triggered when a request is sent to /store-api/navigation/main-navigation/{id}?

Hey there,

I’m looking to enhance the media data included as a custom field within the Navigation data when making a request to /store-api/navigation/main-navigation. To achieve this, I decided to implement a subscriber that listens to NavigationLoadedEvent. But, I’ve encountered an issue where the dd('test') statement isn’t executed, despite the subscriber being correctly registered. I’m wondering if the NavigationLoadedEvent is actually being triggered, when calling this api at all or if I should consider a different approach?

<?php declare(strict_types=1);

namespace Etopia\ApiExtender\Subscriber;

use Shopware\Core\Content\Category\Event\NavigationLoadedEvent;
use Shopware\Core\Content\Media\MediaCollection;
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
use Shopware\Core\Framework\Struct\ArrayStruct;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

class NavigationMediaSubscriber implements EventSubscriberInterface
{
    private $mediaRepository;

    public function __construct(EntityRepositoryInterface $mediaRepository)
    {
        $this->mediaRepository = $mediaRepository;
    }

    public static function getSubscribedEvents(): array
    {
        return [
            NavigationLoadedEvent::class => 'onNavigationLoaded',
        ];
    }

    public function onNavigationLoaded(NavigationLoadedEvent $event): void
    {
        dd('test');
    }
}

Thanks, and apologies, as I’m quite new to Shopware.