I have file where I have form and some JS scripts. I only want to send products/save/clientId/params
but when I do its sending another url - show/ from my form above in this file. How to fix it? Full file to download.
function saveProducts() {
const pathname = window.location.pathname;
const pathSegments = pathname.split('/');
const clientId = pathSegments[pathSegments.length - 1]; // Get the last segment
const urlParams = new URLSearchParams(window.location.search);
uri =save/${clientId}?${urlParams};$.ajax({ type: "GET", url: uri, success: function(result) { console.log("Udalo sie!"); } }); }