Jump to content

Can't use a custom route in js


Recommended Posts

Hi,

I have a module which will add actions to the orders in the back-office. In my module, I decorate the OrderController() and create a route to call my function. but when I want to call the route in javascript, I have the error : The route "mymodule_newaction" does not exist. If I check debug:router in the console, I see the route 

Here is my routes.yml :

mymodule_newaction:
    path: mymodule/{orderId}/newaction
    methods: [POST]
    defaults:
      _controller:  'MyCompany\MyModule\Controller\Admin\Sell\Order\CustomOrderController::newAction'
      _legacy_controller: 'OrderController'
      _legacy_link: 'CustomOrderController::newAction'
    options:
      expose: true
    requirements:
      orderId: \d+

 

I can't figure out how to make the the route work.

Link to comment
Share on other sites

  • 1 year later...

Hi there.

Have you find a solution for this issue? i have the same problem. I'm still searching why custom route from module does not generate when we call it from javascript. Seems Prestashop devs are aware of this problem but even in github no solution was provided.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...