mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-21 21:43:57 +00:00
Laravel Vapor - code sync with Shipping Portal
This commit is contained in:
@@ -6,6 +6,7 @@ export default {
|
||||
return dispatch('ensureReCaptchaIsSet').then(function () {
|
||||
let combinedAbsoluteUrl = endpoint;
|
||||
if(window.LARAVEL_VAPOR_ENABLED){
|
||||
endpoint = encodeSpecificPartOfUrl(endpoint);
|
||||
let queryDomain = endpoint.split('?')[0];
|
||||
let encodedParams = endpoint.split('?')[1];
|
||||
let decodedParams = fullyDecodeURI(encodedParams);
|
||||
@@ -68,3 +69,10 @@ function encodeUrlWithoutQueryParameter(url){
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
function encodeSpecificPartOfUrl(url) {
|
||||
let encodedUrl = url.replace('[','%5B');
|
||||
encodedUrl = encodedUrl.replace(']','%5D');
|
||||
encodedUrl = encodedUrl.replace(',','%2C');
|
||||
return encodedUrl;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ export default {
|
||||
actions: {
|
||||
crudRequestV2({getters, dispatch}, {endpoint, method, parameters}){
|
||||
return dispatch('ensureReCaptchaIsSet').then(function () {
|
||||
endpoint = encodeSpecificPartOfUrl(endpoint);
|
||||
let queryDomain = endpoint.split('?')[0];
|
||||
let encodedParams = endpoint.split('?')[1];
|
||||
let decodedParams = fullyDecodeURI(encodedParams);
|
||||
@@ -64,3 +65,10 @@ function encodeUrlWithoutQueryParameter(url){
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
function encodeSpecificPartOfUrl(url) {
|
||||
let encodedUrl = url.replace('[','%5B');
|
||||
encodedUrl = encodedUrl.replace(']','%5D');
|
||||
encodedUrl = encodedUrl.replace(',','%2C');
|
||||
return encodedUrl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user