Working on Sitecore 9.3.
What I'm trying to do is edit a base .js file, being component-search-url.js
.
Specifically, I want to update the setEndpoint
function to always return the endpoint
. Currently it's possible return url += endpoint;
I've had a look at documentation but I can't seem to find the best method to approach this. I don't want to edit the base theme file because of future updates, so I want to create a js
file in my new theme to update this function. But I'm just not sure how? Any help would be appreciated!
setEndpoint: function (endpoint) {
var url = window.location.origin;
if (endpoint.indexOf(url) !== -1) {
return endpoint;
}
return url += endpoint;
},