@redneckz/wildless-cms-uni-blocks 0.14.1006 → 0.14.1007
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/bundle/bundle.umd.js +16 -5
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/retail/api/apiBaseUrl.d.ts +2 -1
- package/bundle/retail/utils/getBaseUrl.d.ts +1 -0
- package/dist/retail/api/apiBaseUrl.d.ts +2 -1
- package/dist/retail/api/apiBaseUrl.js +3 -2
- package/dist/retail/api/apiBaseUrl.js.map +1 -1
- package/dist/retail/api/doRequest.js +3 -4
- package/dist/retail/api/doRequest.js.map +1 -1
- package/dist/retail/hooks/useLeadFormData.js +3 -2
- package/dist/retail/hooks/useLeadFormData.js.map +1 -1
- package/dist/retail/utils/getBaseUrl.d.ts +1 -0
- package/dist/retail/utils/getBaseUrl.js +13 -0
- package/dist/retail/utils/getBaseUrl.js.map +1 -0
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.fixture.d.ts +1 -0
- package/lib/retail/api/apiBaseUrl.d.ts +2 -1
- package/lib/retail/api/apiBaseUrl.js +2 -1
- package/lib/retail/api/apiBaseUrl.js.map +1 -1
- package/lib/retail/api/doRequest.js +3 -4
- package/lib/retail/api/doRequest.js.map +1 -1
- package/lib/retail/hooks/useLeadFormData.js +3 -2
- package/lib/retail/hooks/useLeadFormData.js.map +1 -1
- package/lib/retail/utils/getBaseUrl.d.ts +1 -0
- package/lib/retail/utils/getBaseUrl.js +10 -0
- package/lib/retail/utils/getBaseUrl.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +16 -5
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/retail/api/apiBaseUrl.d.ts +2 -1
- package/mobile/bundle/retail/utils/getBaseUrl.d.ts +1 -0
- package/mobile/dist/retail/api/apiBaseUrl.d.ts +2 -1
- package/mobile/dist/retail/api/apiBaseUrl.js +3 -2
- package/mobile/dist/retail/api/apiBaseUrl.js.map +1 -1
- package/mobile/dist/retail/api/doRequest.js +3 -4
- package/mobile/dist/retail/api/doRequest.js.map +1 -1
- package/mobile/dist/retail/hooks/useLeadFormData.js +3 -2
- package/mobile/dist/retail/hooks/useLeadFormData.js.map +1 -1
- package/mobile/dist/retail/utils/getBaseUrl.d.ts +1 -0
- package/mobile/dist/retail/utils/getBaseUrl.js +13 -0
- package/mobile/dist/retail/utils/getBaseUrl.js.map +1 -0
- package/mobile/lib/retail/api/apiBaseUrl.d.ts +2 -1
- package/mobile/lib/retail/api/apiBaseUrl.js +2 -1
- package/mobile/lib/retail/api/apiBaseUrl.js.map +1 -1
- package/mobile/lib/retail/api/doRequest.js +3 -4
- package/mobile/lib/retail/api/doRequest.js.map +1 -1
- package/mobile/lib/retail/hooks/useLeadFormData.js +3 -2
- package/mobile/lib/retail/hooks/useLeadFormData.js.map +1 -1
- package/mobile/lib/retail/utils/getBaseUrl.d.ts +1 -0
- package/mobile/lib/retail/utils/getBaseUrl.js +10 -0
- package/mobile/lib/retail/utils/getBaseUrl.js.map +1 -0
- package/mobile/src/retail/api/apiBaseUrl.ts +2 -1
- package/mobile/src/retail/api/doRequest.ts +13 -17
- package/mobile/src/retail/hooks/useLeadFormData.ts +4 -3
- package/mobile/src/retail/utils/getBaseUrl.ts +17 -0
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.fixture.tsx +15 -0
- package/src/retail/api/apiBaseUrl.ts +2 -1
- package/src/retail/api/doRequest.ts +13 -17
- package/src/retail/hooks/useLeadFormData.ts +4 -3
- package/src/retail/utils/getBaseUrl.ts +17 -0
package/bundle/bundle.umd.js
CHANGED
|
@@ -4181,7 +4181,17 @@
|
|
|
4181
4181
|
};
|
|
4182
4182
|
|
|
4183
4183
|
const RETAIL_API_BASE_URI = '/light-api-cash/v1';
|
|
4184
|
-
const
|
|
4184
|
+
const NEW_RETAIL_CREDIT_API_BASE_URI = '/api/credit-application';
|
|
4185
|
+
const NEW_RETAIL_CREDIT_CARD_API_BASE_URI = '/api/creditcard-application';
|
|
4186
|
+
|
|
4187
|
+
const getBaseUrl = () => {
|
|
4188
|
+
const isNewMicroservice = globalThis.sessionStorage?.getItem('isNewMicroservice');
|
|
4189
|
+
const productType = globalThis.localStorage?.getItem('productType');
|
|
4190
|
+
const newRetailApi = productType === '"credit"'
|
|
4191
|
+
? NEW_RETAIL_CREDIT_API_BASE_URI
|
|
4192
|
+
: NEW_RETAIL_CREDIT_CARD_API_BASE_URI;
|
|
4193
|
+
return isNewMicroservice ? newRetailApi : RETAIL_API_BASE_URI;
|
|
4194
|
+
};
|
|
4185
4195
|
|
|
4186
4196
|
const getTraceId = () => {
|
|
4187
4197
|
const result = new Uint8Array(8);
|
|
@@ -4200,9 +4210,9 @@
|
|
|
4200
4210
|
}
|
|
4201
4211
|
};
|
|
4202
4212
|
async function doRequest(url, method, body) {
|
|
4203
|
-
const
|
|
4213
|
+
const baseUrl = getBaseUrl();
|
|
4204
4214
|
const traceId = getTraceId();
|
|
4205
|
-
return globalThis?.fetch?.(`${
|
|
4215
|
+
return globalThis?.fetch?.(`${baseUrl}${url}`, {
|
|
4206
4216
|
method,
|
|
4207
4217
|
headers: {
|
|
4208
4218
|
'Content-Type': 'application/json',
|
|
@@ -5107,7 +5117,8 @@
|
|
|
5107
5117
|
|
|
5108
5118
|
const useLeadFormData = (typeField) => {
|
|
5109
5119
|
const isNewMicroservice = checkNewMicroservice();
|
|
5110
|
-
const
|
|
5120
|
+
const baseUrl = getBaseUrl();
|
|
5121
|
+
const { data, error } = useAsyncData(`${baseUrl}${isNewMicroservice ? `/public-data` : ''}/dictionary?dictionaryType=${encodeURIComponent(typeField)}`, fetchData);
|
|
5111
5122
|
if (data && 'errorMessage' in data) {
|
|
5112
5123
|
return { error };
|
|
5113
5124
|
}
|
|
@@ -14144,7 +14155,7 @@
|
|
|
14144
14155
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
14145
14156
|
});
|
|
14146
14157
|
|
|
14147
|
-
const packageVersion = "0.14.
|
|
14158
|
+
const packageVersion = "0.14.1006";
|
|
14148
14159
|
|
|
14149
14160
|
exports.Blocks = Blocks;
|
|
14150
14161
|
exports.ContentPage = ContentPage;
|