|
|
@@ -38,7 +38,9 @@ export class ShopDetailPage {
|
|
|
private async loadShopDetail(): Promise<void> {
|
|
|
try {
|
|
|
// Load shop details first (critical)
|
|
|
+ console.log('[ShopDetailPage] Loading shop details for:', this.shopId);
|
|
|
const shopResponse = await this.apiService.getShop(this.shopId);
|
|
|
+ console.log('[ShopDetailPage] Shop response:', shopResponse);
|
|
|
|
|
|
if (shopResponse.success && shopResponse.data) {
|
|
|
this.shopDetail = shopResponse.data;
|
|
|
@@ -52,19 +54,25 @@ export class ShopDetailPage {
|
|
|
// 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;
|
|
|
+ } else if (embeddingsResponse.status === 'rejected') {
|
|
|
+ console.warn('[ShopDetailPage] Embeddings failed:', embeddingsResponse.reason);
|
|
|
}
|
|
|
|
|
|
// 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;
|
|
|
+ } else if (errorsResponse.status === 'rejected') {
|
|
|
+ console.warn('[ShopDetailPage] Errors fetch failed:', errorsResponse.reason);
|
|
|
}
|
|
|
|
|
|
this.renderShopDetail();
|
|
|
} else {
|
|
|
+ console.error('[ShopDetailPage] Shop API returned error:', shopResponse.error);
|
|
|
this.toastService.error('Load Error', shopResponse.error || 'Failed to load shop details');
|
|
|
this.router.navigate('/shops');
|
|
|
}
|
|
|
} catch (error) {
|
|
|
+ console.error('[ShopDetailPage] Exception loading shop details:', error);
|
|
|
this.toastService.error('Error', 'Failed to load shop details');
|
|
|
this.router.navigate('/shops');
|
|
|
}
|