@bytebrand/export-cars 1.22.17 → 1.22.19
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/package.json
CHANGED
|
@@ -21,8 +21,21 @@ export class UserService {
|
|
|
21
21
|
return cachedResponse;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
// A valid-but-empty description schema. car-description's MobileDescription does
|
|
25
|
+
// `getBodySchema(schema.body)` / `buildFreeText(schema.{header,footer})` with no guards,
|
|
26
|
+
// so `{}` would crash on `undefined.map`. Empty arrays produce an empty description safely.
|
|
27
|
+
const emptySchema = { body: [], header: [], footer: [] };
|
|
28
|
+
|
|
29
|
+
let result: any = emptySchema;
|
|
30
|
+
try {
|
|
31
|
+
const defaultSummary = await CronicleUtils.retry(() => this.requestService.userActionsRequest.getDefaultSummaryByDealerId(dealerId), 1, 30, true);
|
|
32
|
+
result = get(defaultSummary, 'data.schema', emptySchema);
|
|
33
|
+
} catch (e) {
|
|
34
|
+
// Dealer has no default summary template (user-actions returns 404) — fall back to an
|
|
35
|
+
// empty schema instead of letting the rejection crash the whole export job.
|
|
36
|
+
// Mirrors car-platform-sync UserActionsService.getDefaultSummaryByDealerId behaviour.
|
|
37
|
+
console.log('getDefaultSummaryByDealerId', dealerId, get(e, 'message', e));
|
|
38
|
+
}
|
|
26
39
|
await this.cacheManager.set(cacheKey, result);
|
|
27
40
|
|
|
28
41
|
return result;
|