diff --git a/.env.example b/.env.example index 58832db..4ce3a03 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,4 @@ REACT_APP_API_URL=your-backend-url REACT_APP_MAPBOX_TOKEN=your-mapbox-app-token -REACT_APP_IMAGE_PREFIX=your-supabase-storage-image-folder-name REACT_APP_SUPABASE_BUCKET_PATH=your-supabae-bucket-path REACT_APP_SUPABASE_SECRET_API_KEY=your-supabase-secret-api-key \ No newline at end of file diff --git a/src/api/photo/photoApiIndex.ts b/src/api/photo/photoApiIndex.ts index 9a533e4..8cdc323 100644 --- a/src/api/photo/photoApiIndex.ts +++ b/src/api/photo/photoApiIndex.ts @@ -18,14 +18,13 @@ export const getMenuPhotos = async ( }; export const createMenuPhoto = async ( - imagePrefix: string, restaurantID: string, imageName: string, photoCategory: string ): Promise => { return apiClient.post( "", - { imagePrefix, restaurantID, imageName }, + { restaurantID, imageName }, { params: { photoCategory } } ); }; diff --git a/src/api/restaurant/restaurantApiIndex.ts b/src/api/restaurant/restaurantApiIndex.ts index 5a33a5a..c56dbb6 100644 --- a/src/api/restaurant/restaurantApiIndex.ts +++ b/src/api/restaurant/restaurantApiIndex.ts @@ -22,7 +22,8 @@ export const getRestaurantDetail = async ( }; export const createRestaurant = async ( - restaurant: CreateRestaurantType + restaurant: CreateRestaurantType, + fileExtension?: string ): Promise => { - return apiClient.post("", restaurant); + return apiClient.post("", { restaurant, fileExtension }); }; diff --git a/src/api/restaurantOwner/RestaurantOwnerType.ts b/src/api/restaurantOwner/RestaurantOwnerType.ts new file mode 100644 index 0000000..b889f27 --- /dev/null +++ b/src/api/restaurantOwner/RestaurantOwnerType.ts @@ -0,0 +1,4 @@ +export type RestaurantOwner = { + user_id: string; + restaurant_id: string; +}; diff --git a/src/api/restaurantOwner/restaurantOwnerApiIndex.ts b/src/api/restaurantOwner/restaurantOwnerApiIndex.ts new file mode 100644 index 0000000..06a2955 --- /dev/null +++ b/src/api/restaurantOwner/restaurantOwnerApiIndex.ts @@ -0,0 +1,12 @@ +import { AxiosApiClientBuilder } from "../axiosIndex"; +import { RestaurantOwner } from "./RestaurantOwnerType"; + +const apiClient = new AxiosApiClientBuilder() + .withResourceName("/restaurant/owner") + .build(); + +export const createRestaurantOwner = async ( + restaurantOwner: RestaurantOwner +): Promise => { + return apiClient.post("", restaurantOwner); +}; diff --git a/src/api/review/reviewApiIndex.ts b/src/api/review/reviewApiIndex.ts index 8b6830d..c1722d4 100644 --- a/src/api/review/reviewApiIndex.ts +++ b/src/api/review/reviewApiIndex.ts @@ -17,14 +17,13 @@ export const getReviewsByRestaurantID = async ( export const createReview = async ( createReviewDto: CreateReviewDto, - imagePrefix: string, restaurantID: string, photoCategory: string, fileExtension?: string ): Promise => { return apiClient.post( "", - { createReviewDto, imagePrefix, restaurantID, fileExtension }, + { createReviewDto, restaurantID, fileExtension }, { params: { photoCategory } } ); }; diff --git a/src/components/utils/cards/RestaurantCard.tsx b/src/components/utils/cards/RestaurantCard.tsx index 360d1e0..859a72a 100644 --- a/src/components/utils/cards/RestaurantCard.tsx +++ b/src/components/utils/cards/RestaurantCard.tsx @@ -21,11 +21,13 @@ const RestaurantCard: React.FC = (props: Restaurant) => { className="rounded-md shadow-lg hover:bg-slate-200" >
- {props.name} + {props.cover_image_url && ( + {props.name} + )}
} /> diff --git a/src/components/utils/inputs/NumberInput.tsx b/src/components/utils/inputs/NumberInput.tsx index 92c3b4b..5729237 100644 --- a/src/components/utils/inputs/NumberInput.tsx +++ b/src/components/utils/inputs/NumberInput.tsx @@ -18,10 +18,10 @@ const NumberInput: React.FC = ({ max, }) => { return ( -
- +
+ = ({ onChange, }) => { return ( -
- +
+ ) => onChange(e)} diff --git a/src/components/utils/inputs/SelectInput.tsx b/src/components/utils/inputs/SelectInput.tsx index 3541120..9ebbda4 100644 --- a/src/components/utils/inputs/SelectInput.tsx +++ b/src/components/utils/inputs/SelectInput.tsx @@ -21,8 +21,8 @@ const SelectInput: React.FC = ({ optionList, }) => { return ( -
- +
+