|
@@ -37,22 +37,26 @@ export class ShopDetailPage {
|
|
|
|
|
|
|
|
private async loadShopDetail(): Promise<void> {
|
|
private async loadShopDetail(): Promise<void> {
|
|
|
try {
|
|
try {
|
|
|
- // Load shop details and Qdrant data in parallel
|
|
|
|
|
- const [shopResponse, embeddingsResponse, errorsResponse] = await Promise.all([
|
|
|
|
|
- this.apiService.getShop(this.shopId),
|
|
|
|
|
- this.apiService.getShopQdrantEmbeddings(this.shopId),
|
|
|
|
|
- this.apiService.getShopQdrantErrors(this.shopId)
|
|
|
|
|
- ]);
|
|
|
|
|
|
|
+ // Load shop details first (critical)
|
|
|
|
|
+ const shopResponse = await this.apiService.getShop(this.shopId);
|
|
|
|
|
|
|
|
if (shopResponse.success && shopResponse.data) {
|
|
if (shopResponse.success && shopResponse.data) {
|
|
|
this.shopDetail = shopResponse.data;
|
|
this.shopDetail = shopResponse.data;
|
|
|
|
|
|
|
|
- // Load Qdrant data (these can fail without breaking the page)
|
|
|
|
|
- if (embeddingsResponse.success && embeddingsResponse.data) {
|
|
|
|
|
- this.qdrantEmbeddings = embeddingsResponse.data.embeddings;
|
|
|
|
|
|
|
+ // Load Qdrant data in parallel (optional - these can fail without breaking the page)
|
|
|
|
|
+ const [embeddingsResponse, errorsResponse] = await Promise.allSettled([
|
|
|
|
|
+ this.apiService.getShopQdrantEmbeddings(this.shopId),
|
|
|
|
|
+ this.apiService.getShopQdrantErrors(this.shopId)
|
|
|
|
|
+ ]);
|
|
|
|
|
+
|
|
|
|
|
+ // Handle embeddings response (won't break if it fails)
|
|
|
|
|
+ if (embeddingsResponse.status === 'fulfilled' && embeddingsResponse.value.success && embeddingsResponse.value.data) {
|
|
|
|
|
+ this.qdrantEmbeddings = embeddingsResponse.value.data.embeddings;
|
|
|
}
|
|
}
|
|
|
- if (errorsResponse.success && errorsResponse.data) {
|
|
|
|
|
- this.qdrantErrors = errorsResponse.data.errors;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // Handle errors response (won't break if it fails)
|
|
|
|
|
+ if (errorsResponse.status === 'fulfilled' && errorsResponse.value.success && errorsResponse.value.data) {
|
|
|
|
|
+ this.qdrantErrors = errorsResponse.value.data.errors;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
this.renderShopDetail();
|
|
this.renderShopDetail();
|