ingeniuscliq-core 0.5.67 → 0.5.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/helpers/axiosGlobal.d.ts.map +1 -1
- package/dist/helpers/axiosGlobal.js +5 -2
- package/dist/helpers/image.d.ts.map +1 -1
- package/dist/helpers/image.js +3 -0
- package/dist/modules/CoreCustomization/classes/CoreCustomizationBuilder.d.ts.map +1 -1
- package/dist/modules/CoreCustomization/classes/CoreCustomizationBuilder.js +2 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axiosGlobal.d.ts","sourceRoot":"","sources":["../../src/helpers/axiosGlobal.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAA8B,MAAM,OAAO,CAAC;AAGzE,eAAO,IAAI,GAAG,EAAE,aAMd,CAAC;AAIH;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM,KAAG,
|
|
1
|
+
{"version":3,"file":"axiosGlobal.d.ts","sourceRoot":"","sources":["../../src/helpers/axiosGlobal.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAA8B,MAAM,OAAO,CAAC;AAGzE,eAAO,IAAI,GAAG,EAAE,aAMd,CAAC;AAIH;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM,KAAG,IAqClD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAU,SAAS,MAAM,KAAG,OAAO,CAAC,OAAO,CAYtE,CAAC;AAuBF,eAAe,GAAG,CAAC"}
|
|
@@ -12,8 +12,7 @@ const initAxiosConfigs = (baseURL) => {
|
|
|
12
12
|
api.interceptors.request.use(
|
|
13
13
|
async (config) => {
|
|
14
14
|
config.baseURL = baseURL;
|
|
15
|
-
config.headers["X-
|
|
16
|
-
config.headers["X-Original-Host"] = window.location.host.split(":")[0];
|
|
15
|
+
config.headers["X-Tenant"] = window.location.host.split(":")[0];
|
|
17
16
|
if (!config.url?.includes("sanctum/csrf-cookie")) {
|
|
18
17
|
if (!document.cookie.includes("XSRF-TOKEN") && !config.url?.includes("sanctum/csrf-cookie")) {
|
|
19
18
|
await ensureCsrfToken(baseURL);
|
|
@@ -40,6 +39,7 @@ const initAxiosConfigs = (baseURL) => {
|
|
|
40
39
|
);
|
|
41
40
|
};
|
|
42
41
|
const ensureCsrfToken = async (baseURL) => {
|
|
42
|
+
console.log("Ensuring csrf token");
|
|
43
43
|
if (!csrfTokenFetched) {
|
|
44
44
|
try {
|
|
45
45
|
await api.get(`${baseURL}/sanctum/csrf-cookie`);
|
|
@@ -52,10 +52,13 @@ const ensureCsrfToken = async (baseURL) => {
|
|
|
52
52
|
return true;
|
|
53
53
|
};
|
|
54
54
|
const attachCsrfToken = (config) => {
|
|
55
|
+
console.log("Attaching");
|
|
56
|
+
console.log(document.cookie, "document cookie");
|
|
55
57
|
const xsrfCookie = document.cookie.split("; ").find((cookie) => cookie.startsWith("XSRF-TOKEN="));
|
|
56
58
|
if (xsrfCookie) {
|
|
57
59
|
const token = xsrfCookie.split("=")[1];
|
|
58
60
|
const decodedToken = decodeURIComponent(token);
|
|
61
|
+
console.log(config.headers, "config-headers");
|
|
59
62
|
if (config.headers) {
|
|
60
63
|
config.headers["X-XSRF-TOKEN"] = decodedToken;
|
|
61
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/helpers/image.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/helpers/image.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,UAc9C"}
|
package/dist/helpers/image.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreCustomizationBuilder.d.ts","sourceRoot":"","sources":["../../../../src/modules/CoreCustomization/classes/CoreCustomizationBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE,qBAAa,wBAAwB,CACnC,MAAM,SAAS,sBAAsB,GAAG,sBAAsB,CAC9D,SAAQ,eAAe,CAAC,MAAM,CAAC;IAC/B,SAAS,CAAC,oBAAoB,EAAE,4BAA4B,CAAC;IAC7D,SAAS,CAAC,YAAY,EAOjB,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC;gBAGzF,OAAO,GAAE,4BAAiE,EAC1E,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC;IAShC,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"CoreCustomizationBuilder.d.ts","sourceRoot":"","sources":["../../../../src/modules/CoreCustomization/classes/CoreCustomizationBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE,qBAAa,wBAAwB,CACnC,MAAM,SAAS,sBAAsB,GAAG,sBAAsB,CAC9D,SAAQ,eAAe,CAAC,MAAM,CAAC;IAC/B,SAAS,CAAC,oBAAoB,EAAE,4BAA4B,CAAC;IAC7D,SAAS,CAAC,YAAY,EAOjB,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC;gBAGzF,OAAO,GAAE,4BAAiE,EAC1E,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC;IAShC,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,MAAM;IA8G5C,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiBb"}
|
|
@@ -99,7 +99,8 @@ class CoreCustomizationBuilder extends CoreBaseBuilder {
|
|
|
99
99
|
actions?.onSuccess?.(response);
|
|
100
100
|
return response.data;
|
|
101
101
|
} catch (error) {
|
|
102
|
-
|
|
102
|
+
const errorMessage = error?.response?.data?.message || error?.message || "An error occurred";
|
|
103
|
+
set({ loading: false, error: errorMessage });
|
|
103
104
|
actions?.onError?.(error);
|
|
104
105
|
throw error;
|
|
105
106
|
} finally {
|