# This file is part of the Sylius package.
# (c) Sylius Sp. z o.o.

sylius_shop_partial_product_index_latest:
    path: /latest/{count}
    methods: [GET]
    defaults:
        _controller: sylius.controller.product::indexAction
        _sylius:
            template: $template
            repository:
                method: findLatestByChannel
                arguments:
                    - "expr:service('sylius.context.channel').getChannel()"
                    - "expr:service('sylius.context.locale').getLocaleCode()"
                    - '!!int $count'

sylius_shop_partial_product_show_by_slug:
    path: /{slug}
    methods: [GET]
    defaults:
        _controller: sylius.controller.product::showAction
        _sylius:
            template: $template
            repository:
                method: findOneByChannelAndSlug
                arguments:
                    - "expr:service('sylius.context.channel').getChannel()"
                    - "expr:service('sylius.context.locale').getLocaleCode()"
                    - $slug
