@wix/headless-bookings 0.0.115 → 0.0.116
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.
|
@@ -183,7 +183,7 @@ exports.ServiceListService = services_definitions_1.implementService.withConfig(
|
|
|
183
183
|
// Use effectiveFilterSignal.peek() to get the computed filter value
|
|
184
184
|
const effectiveFilter = effectiveFilterSignal.peek();
|
|
185
185
|
isLoadingSignal.set(true);
|
|
186
|
-
Promise.
|
|
186
|
+
Promise.allSettled([
|
|
187
187
|
(0, index_js_1.queryServices)({
|
|
188
188
|
appId: initialQueryOptions.appId,
|
|
189
189
|
filter: effectiveFilter,
|
|
@@ -195,15 +195,21 @@ exports.ServiceListService = services_definitions_1.implementService.withConfig(
|
|
|
195
195
|
}),
|
|
196
196
|
!hasInitialCategories ? (0, index_js_2.queryCategories)() : Promise.resolve(null),
|
|
197
197
|
])
|
|
198
|
-
.then(([
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
categoriesSignal.set(categoriesResult.categories);
|
|
198
|
+
.then(([servicesSettled, categoriesSettled]) => {
|
|
199
|
+
if (servicesSettled.status === 'fulfilled') {
|
|
200
|
+
servicesSignal.set(servicesSettled.value.services);
|
|
201
|
+
pagingMetadataSignal.set(servicesSettled.value.pagingMetadata);
|
|
203
202
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
203
|
+
else {
|
|
204
|
+
errorSignal.set(servicesSettled.reason instanceof Error
|
|
205
|
+
? servicesSettled.reason.message
|
|
206
|
+
: 'Unknown error');
|
|
207
|
+
}
|
|
208
|
+
if (categoriesSettled.status === 'fulfilled' &&
|
|
209
|
+
categoriesSettled.value) {
|
|
210
|
+
categoriesSignal.set(categoriesSettled.value.categories);
|
|
211
|
+
}
|
|
212
|
+
// If categories fail, silently keep empty categories — filter won't be shown
|
|
207
213
|
})
|
|
208
214
|
.finally(() => {
|
|
209
215
|
isLoadingSignal.set(false);
|
|
@@ -379,7 +385,7 @@ exports.ServiceListService = services_definitions_1.implementService.withConfig(
|
|
|
379
385
|
*/
|
|
380
386
|
async function loadServiceListServiceInitialData(options) {
|
|
381
387
|
try {
|
|
382
|
-
// Fetch services and categories in parallel
|
|
388
|
+
// Fetch services and categories in parallel; categories failure is non-fatal
|
|
383
389
|
const [servicesResult, categoriesResult] = await Promise.all([
|
|
384
390
|
(0, index_js_1.queryServices)({
|
|
385
391
|
appId: options.appId,
|
|
@@ -387,13 +393,13 @@ async function loadServiceListServiceInitialData(options) {
|
|
|
387
393
|
pagingMetadata: options.pagingMetadata,
|
|
388
394
|
sort: options.sort,
|
|
389
395
|
}),
|
|
390
|
-
(0, index_js_2.queryCategories)(),
|
|
396
|
+
(0, index_js_2.queryCategories)().catch(() => null),
|
|
391
397
|
]);
|
|
392
398
|
return {
|
|
393
399
|
type: 'success',
|
|
394
400
|
config: {
|
|
395
401
|
services: servicesResult.services,
|
|
396
|
-
categories: categoriesResult
|
|
402
|
+
categories: categoriesResult?.categories ?? [],
|
|
397
403
|
options: {
|
|
398
404
|
...options,
|
|
399
405
|
pagingMetadata: servicesResult.pagingMetadata,
|
|
@@ -179,7 +179,7 @@ export const ServiceListService = implementService.withConfig()(ServiceListServi
|
|
|
179
179
|
// Use effectiveFilterSignal.peek() to get the computed filter value
|
|
180
180
|
const effectiveFilter = effectiveFilterSignal.peek();
|
|
181
181
|
isLoadingSignal.set(true);
|
|
182
|
-
Promise.
|
|
182
|
+
Promise.allSettled([
|
|
183
183
|
queryServices({
|
|
184
184
|
appId: initialQueryOptions.appId,
|
|
185
185
|
filter: effectiveFilter,
|
|
@@ -191,15 +191,21 @@ export const ServiceListService = implementService.withConfig()(ServiceListServi
|
|
|
191
191
|
}),
|
|
192
192
|
!hasInitialCategories ? queryCategories() : Promise.resolve(null),
|
|
193
193
|
])
|
|
194
|
-
.then(([
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
categoriesSignal.set(categoriesResult.categories);
|
|
194
|
+
.then(([servicesSettled, categoriesSettled]) => {
|
|
195
|
+
if (servicesSettled.status === 'fulfilled') {
|
|
196
|
+
servicesSignal.set(servicesSettled.value.services);
|
|
197
|
+
pagingMetadataSignal.set(servicesSettled.value.pagingMetadata);
|
|
199
198
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
199
|
+
else {
|
|
200
|
+
errorSignal.set(servicesSettled.reason instanceof Error
|
|
201
|
+
? servicesSettled.reason.message
|
|
202
|
+
: 'Unknown error');
|
|
203
|
+
}
|
|
204
|
+
if (categoriesSettled.status === 'fulfilled' &&
|
|
205
|
+
categoriesSettled.value) {
|
|
206
|
+
categoriesSignal.set(categoriesSettled.value.categories);
|
|
207
|
+
}
|
|
208
|
+
// If categories fail, silently keep empty categories — filter won't be shown
|
|
203
209
|
})
|
|
204
210
|
.finally(() => {
|
|
205
211
|
isLoadingSignal.set(false);
|
|
@@ -375,7 +381,7 @@ export const ServiceListService = implementService.withConfig()(ServiceListServi
|
|
|
375
381
|
*/
|
|
376
382
|
export async function loadServiceListServiceInitialData(options) {
|
|
377
383
|
try {
|
|
378
|
-
// Fetch services and categories in parallel
|
|
384
|
+
// Fetch services and categories in parallel; categories failure is non-fatal
|
|
379
385
|
const [servicesResult, categoriesResult] = await Promise.all([
|
|
380
386
|
queryServices({
|
|
381
387
|
appId: options.appId,
|
|
@@ -383,13 +389,13 @@ export async function loadServiceListServiceInitialData(options) {
|
|
|
383
389
|
pagingMetadata: options.pagingMetadata,
|
|
384
390
|
sort: options.sort,
|
|
385
391
|
}),
|
|
386
|
-
queryCategories(),
|
|
392
|
+
queryCategories().catch(() => null),
|
|
387
393
|
]);
|
|
388
394
|
return {
|
|
389
395
|
type: 'success',
|
|
390
396
|
config: {
|
|
391
397
|
services: servicesResult.services,
|
|
392
|
-
categories: categoriesResult
|
|
398
|
+
categories: categoriesResult?.categories ?? [],
|
|
393
399
|
options: {
|
|
394
400
|
...options,
|
|
395
401
|
pagingMetadata: servicesResult.pagingMetadata,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/headless-bookings",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.116",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"groupId": "com.wixpress.headless-components"
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
|
-
"falconPackageHash": "
|
|
76
|
+
"falconPackageHash": "96b4aee5fd93e8621d0abf4d240bc28225e45e66505e7b24823f7710"
|
|
77
77
|
}
|