@posiwise/admin-module 0.0.163 → 0.0.164
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.
|
@@ -1191,51 +1191,32 @@ class DomainConfigBuildComponent extends AppBaseComponent {
|
|
|
1191
1191
|
});
|
|
1192
1192
|
this.shardUrl = res?.config?.shard_url;
|
|
1193
1193
|
const fixedData = { ...this.data };
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
}
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
fixedData
|
|
1214
|
-
}
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
}
|
|
1221
|
-
if (!fixedData.guides || typeof fixedData.guides !== 'object' || !Array.isArray(fixedData.guides.items)) {
|
|
1222
|
-
fixedData.guides = { ...fixedData.guides, items: [] };
|
|
1223
|
-
}
|
|
1224
|
-
if (!fixedData.navbar || typeof fixedData.navbar !== 'object' || !Array.isArray(fixedData.navbar.items)) {
|
|
1225
|
-
fixedData.navbar = { ...fixedData.navbar, items: [] };
|
|
1226
|
-
}
|
|
1227
|
-
if (!fixedData.footer_links || typeof fixedData.footer_links !== 'object' || !Array.isArray(fixedData.footer_links.items)) {
|
|
1228
|
-
fixedData.footer_links = { ...fixedData.footer_links, items: [] };
|
|
1229
|
-
}
|
|
1230
|
-
if (!fixedData.contact_us || typeof fixedData.contact_us !== 'object') {
|
|
1231
|
-
fixedData.contact_us = { ...fixedData.contact_us };
|
|
1232
|
-
}
|
|
1233
|
-
if (!fixedData.contact_us.questions || !Array.isArray(fixedData.contact_us.questions)) {
|
|
1234
|
-
fixedData.contact_us.questions = [];
|
|
1235
|
-
}
|
|
1236
|
-
if (!fixedData.contact_us.hubspot || !Array.isArray(fixedData.contact_us.hubspot)) {
|
|
1237
|
-
fixedData.contact_us.hubspot = [];
|
|
1238
|
-
}
|
|
1194
|
+
const ensureArrayField = (obj, key) => {
|
|
1195
|
+
if (!obj || typeof obj !== 'object' || !Array.isArray(obj[key])) {
|
|
1196
|
+
obj = { ...obj, [key]: [] };
|
|
1197
|
+
}
|
|
1198
|
+
return obj;
|
|
1199
|
+
};
|
|
1200
|
+
const keysWithItems = [
|
|
1201
|
+
'testimonials',
|
|
1202
|
+
'book_demo',
|
|
1203
|
+
'partners',
|
|
1204
|
+
'videos',
|
|
1205
|
+
'integrations',
|
|
1206
|
+
'usps',
|
|
1207
|
+
'ctas',
|
|
1208
|
+
'guides',
|
|
1209
|
+
'navbar',
|
|
1210
|
+
'footer_links'
|
|
1211
|
+
];
|
|
1212
|
+
keysWithItems.forEach((key) => {
|
|
1213
|
+
fixedData[key] = ensureArrayField(fixedData[key], 'items');
|
|
1214
|
+
});
|
|
1215
|
+
fixedData.ab_tests = Array.isArray(fixedData.ab_tests) ? fixedData.ab_tests : [];
|
|
1216
|
+
fixedData.header = ensureArrayField(fixedData.header, 'sub_headings');
|
|
1217
|
+
fixedData.contact_us = typeof fixedData.contact_us === 'object' && fixedData.contact_us !== null ? { ...fixedData.contact_us } : {};
|
|
1218
|
+
fixedData.contact_us.questions = Array.isArray(fixedData.contact_us.questions) ? fixedData.contact_us.questions : [];
|
|
1219
|
+
fixedData.contact_us.hubspot = Array.isArray(fixedData.contact_us.hubspot) ? fixedData.contact_us.hubspot : [];
|
|
1239
1220
|
this.form.patchValue(fixedData);
|
|
1240
1221
|
this.form.patchValue({
|
|
1241
1222
|
cs_product_id: this.productsList.find(x => x.id === this.data?.cs_product_id),
|