cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.4 constructing controller URL admin(backend) in JavaScript

Magento 2.4 constructing controller URL admin(backend) in JavaScript

I tried to make a simple ajax call to my controller, but I can't generate the url to make the request

 

requirejs(['jquery', 'Magento_Ui/js/modal/confirm', 'mage/url'], function ($, confirmation, urlBuilder) {
'use strict';
(requestUrl);

Try using requirejs, define, it doesn't generate the url needed to make the request to the controller, replace "'/productpricequote/email/send'" with "'/admin/productpricequote/email/send'", in the same way you send an error why it does not generate the key from the url => 'key/28074ed334019dac321376c4729761d20c4b04a8cb7fe4c1a54a1fb7b6d3200b/"

For lack of the key, it sends error 302, otherwise it sends error 404

Can anyone help me out? Please