We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 575e979 commit 3b9e8f1Copy full SHA for 3b9e8f1
1 file changed
src/services/api.ts
@@ -75,6 +75,11 @@ export const apiService = {
75
76
const data = await response.json() as ApiProductSummary[];
77
78
+ if (!data || data.length === 0) {
79
+ console.warn('Veritabanında ürün bulunamadı, mock veriler kullanılıyor.');
80
+ return searchAndSimulateProducts(filters.query || '', filters.category || 'all');
81
+ }
82
+
83
// Gelen veriyi Expo modeline uyarla
84
return data.map((item: ApiProductSummary): Product => {
85
const pricesObj: Record<string, number | null> = {
0 commit comments