=> {
+ try {
+ const response = await axios.get(`${API_BASE_URL}/${teamId}/wines/recommended?limit=${limit}`);
+ return response.data;
+ } catch (error) {
+ console.error('Failed to fetch recommended wines:', error);
+ throw error;
+ }
+};
diff --git a/src/pages/wines/index.tsx b/src/pages/wines/index.tsx
index 4ea9ec66..4461d227 100644
--- a/src/pages/wines/index.tsx
+++ b/src/pages/wines/index.tsx
@@ -2,7 +2,6 @@ import WineFilter from '@/components/common/winelist/WineFilter';
import WineListCard from '@/components/common/winelist/WineListCard';
import WineSlider from '@/components/common/winelist/WineSlider';
-////
export default function Wines() {
return (
diff --git a/src/stores/filterStore.ts b/src/stores/filterStore.ts
index a59a8fd5..e5122aed 100644
--- a/src/stores/filterStore.ts
+++ b/src/stores/filterStore.ts
@@ -1,6 +1,6 @@
import { create } from 'zustand';
-export type WineType = 'Red' | 'White' | 'Sparkling';
+export type WineType = 'RED' | 'WHITE' | 'SPARKLING';
type FilterState = {
type: WineType;
diff --git a/src/stores/wineAddStore.ts b/src/stores/wineAddStore.ts
index 108f8326..1a0373ea 100644
--- a/src/stores/wineAddStore.ts
+++ b/src/stores/wineAddStore.ts
@@ -29,215 +29,6 @@ const useWineAddStore = create((set) => ({
review:
'Cherry, cocoa, vanilla and clove - beautiful red fruit driven Amarone. Low acidity and medium tannins. Nice long velvety finish.',
},
- {
- id: 2,
- name: 'Palazzo della Torre 2017',
- region: 'Western Cape, South Africa',
- image: '/images/image3.svg',
- price: 64900,
- rating: 4.6,
- type: 'Sparkling',
- review:
- 'Cherry, cocoa, vanilla and clove - beautiful red fruit driven Amarone. Low acidity and medium tannins. Nice long velvety finish.',
- },
- {
- id: 3,
- name: 'Sentinel Carbernet Sauvignon 2016',
- region: 'Western Cape, South Africa',
- image: '/images/image2.svg',
- price: 59900,
- rating: 3.6,
- type: 'White',
- review:
- 'Cherry, cocoa, vanilla and clove - beautiful red fruit driven Amarone. Low acidity and medium tannins. Nice long velvety finish.',
- },
- {
- id: 4,
- name: 'Palazzo della Torre 2017',
- region: 'Western Cape, South Africa',
- image: '/images/image4.svg',
- price: 74000,
- rating: 2.1,
- type: 'Red',
- review:
- 'Cherry, cocoa, vanilla and clove - beautiful red fruit driven Amarone. Low acidity and medium tannins. Nice long velvety finish.',
- },
- {
- id: 5,
- name: 'Sentinel Carbernet Sauvignon 2016',
- region: 'Western Cape, South Africa',
- image: '/images/image1.svg',
- price: 64900,
- rating: 4.5,
- type: 'Red',
- review:
- 'Cherry, cocoa, vanilla and clove - beautiful red fruit driven Amarone. Low acidity and medium tannins. Nice long velvety finish.',
- },
- {
- id: 6,
- name: 'Palazzo della Torre 2017',
- region: 'Western Cape, South Africa',
- image: '/images/image3.svg',
- price: 64900,
- rating: 4.6,
- type: 'Red',
- review:
- 'Cherry, cocoa, vanilla and clove - beautiful red fruit driven Amarone. Low acidity and medium tannins. Nice long velvety finish.',
- },
- {
- id: 7,
- name: 'Sentinel Carbernet Sauvignon 2016',
- region: 'Western Cape, South Africa',
- image: '/images/image2.svg',
- price: 59900,
- rating: 3.6,
- type: 'Red',
- review:
- 'Cherry, cocoa, vanilla and clove - beautiful red fruit driven Amarone. Low acidity and medium tannins. Nice long velvety finish.',
- },
- {
- id: 8,
- name: 'Palazzo della Torre 2017',
- region: 'Western Cape, South Africa',
- image: '/images/image4.svg',
- price: 74000,
- rating: 2.1,
- type: 'Red',
- review:
- 'Cherry, cocoa, vanilla and clove - beautiful red fruit driven Amarone. Low acidity and medium tannins. Nice long velvety finish.',
- },
- {
- id: 9,
- name: 'Sentinel Carbernet Sauvignon 2016',
- region: 'Western Cape, South Africa',
- image: '/images/image1.svg',
- price: 64900,
- rating: 4.5,
- type: 'Red',
- review:
- 'Cherry, cocoa, vanilla and clove - beautiful red fruit driven Amarone. Low acidity and medium tannins. Nice long velvety finish.',
- },
- {
- id: 10,
- name: 'Palazzo della Torre 2017',
- region: 'Western Cape, South Africa',
- image: '/images/image3.svg',
- price: 64900,
- rating: 4.6,
- type: 'Red',
- review:
- 'Cherry, cocoa, vanilla and clove - beautiful red fruit driven Amarone. Low acidity and medium tannins. Nice long velvety finish.',
- },
- {
- id: 11,
- name: 'Sentinel Carbernet Sauvignon 2016',
- region: 'Western Cape, South Africa',
- image: '/images/image2.svg',
- price: 59900,
- rating: 3.6,
- type: 'Red',
- review:
- 'Cherry, cocoa, vanilla and clove - beautiful red fruit driven Amarone. Low acidity and medium tannins. Nice long velvety finish.',
- },
- {
- id: 12,
- name: 'Palazzo della Torre 2017',
- region: 'Western Cape, South Africa',
- image: '/images/image4.svg',
- price: 74000,
- rating: 2.1,
- type: 'Red',
- review:
- 'Cherry, cocoa, vanilla and clove - beautiful red fruit driven Amarone. Low acidity and medium tannins. Nice long velvety finish.',
- },
- {
- id: 13,
- name: 'Sentinel Carbernet Sauvignon 2016',
- region: 'Western Cape, South Africa',
- image: '/images/image1.svg',
- price: 64900,
- rating: 4.5,
- type: 'Red',
- review:
- 'Cherry, cocoa, vanilla and clove - beautiful red fruit driven Amarone. Low acidity and medium tannins. Nice long velvety finish.',
- },
- {
- id: 14,
- name: 'Palazzo della Torre 2017',
- region: 'Western Cape, South Africa',
- image: '/images/image3.svg',
- price: 64900,
- rating: 4.6,
- type: 'Red',
- review:
- 'Cherry, cocoa, vanilla and clove - beautiful red fruit driven Amarone. Low acidity and medium tannins. Nice long velvety finish.',
- },
- {
- id: 15,
- name: 'Sentinel Carbernet Sauvignon 2016',
- region: 'Western Cape, South Africa',
- image: '/images/image2.svg',
- price: 59900,
- rating: 3.6,
- type: 'Red',
- review:
- 'Cherry, cocoa, vanilla and clove - beautiful red fruit driven Amarone. Low acidity and medium tannins. Nice long velvety finish.',
- },
- {
- id: 16,
- name: 'Palazzo della Torre 2017',
- region: 'Western Cape, South Africa',
- image: '/images/image4.svg',
- price: 74000,
- rating: 2.1,
- type: 'Red',
- review:
- 'Cherry, cocoa, vanilla and clove - beautiful red fruit driven Amarone. Low acidity and medium tannins. Nice long velvety finish.',
- },
- {
- id: 17,
- name: 'Sentinel Carbernet Sauvignon 2016',
- region: 'Western Cape, South Africa',
- image: '/images/image1.svg',
- price: 64900,
- rating: 4.5,
- type: 'Red',
- review:
- 'Cherry, cocoa, vanilla and clove - beautiful red fruit driven Amarone. Low acidity and medium tannins. Nice long velvety finish.',
- },
- {
- id: 18,
- name: 'Palazzo della Torre 2017',
- region: 'Western Cape, South Africa',
- image: '/images/image3.svg',
- price: 64900,
- rating: 4.6,
- type: 'Red',
- review:
- 'Cherry, cocoa, vanilla and clove - beautiful red fruit driven Amarone. Low acidity and medium tannins. Nice long velvety finish.',
- },
- {
- id: 19,
- name: 'Sentinel Carbernet Sauvignon 2016',
- region: 'Western Cape, South Africa',
- image: '/images/image2.svg',
- price: 59900,
- rating: 3.6,
- type: 'Red',
- review:
- 'Cherry, cocoa, vanilla and clove - beautiful red fruit driven Amarone. Low acidity and medium tannins. Nice long velvety finish.',
- },
- {
- id: 20,
- name: 'Palazzo della Torre 2017',
- region: 'Western Cape, South Africa',
- image: '/images/image4.svg',
- price: 74000,
- rating: 2.1,
- type: 'Red',
- review:
- 'Cherry, cocoa, vanilla and clove - beautiful red fruit driven Amarone. Low acidity and medium tannins. Nice long velvety finish.',
- },
],
addWine: (newWine) =>
diff --git a/src/types/wineListType.ts b/src/types/wineListType.ts
new file mode 100644
index 00000000..164cbf29
--- /dev/null
+++ b/src/types/wineListType.ts
@@ -0,0 +1,48 @@
+export interface Wine {
+ id: number;
+ name: string;
+ region: string;
+ image: string;
+ price: number;
+ type: 'RED' | 'WHITE' | 'SPARKLING';
+ avgRating: number;
+ reviewCount: number;
+ recentReview: {
+ id: number;
+ content: string;
+ createdAt: string;
+ updatedAt: string;
+ } | null;
+ userId: number;
+}
+
+export interface RecommendedWine {
+ id: number;
+ name: string;
+ region: string;
+ image: string;
+ price: number;
+ type: 'RED' | 'WHITE' | 'SPARKLING';
+ avgRating: number;
+}
+
+export interface GetWinesParams {
+ teamId: string;
+ cursor?: number | null;
+ limit?: number;
+ filters: {
+ type?: string;
+ minPrice?: number;
+ maxPrice?: number;
+ rating?: number;
+ searchTerm?: string;
+ };
+}
+
+export interface GetWinesResponse {
+ list: Wine[];
+ totalCount: number;
+ nextCursor: number | null;
+}
+
+export type RecommendedWineResponse = RecommendedWine[];