Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] 명세서에 맞추어 foodId 변경 #199

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/api/hooks/Food/useAddNonPreferenceFood.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const getAddNonPreferenceFoodPath = () => `${baseURL}/non-preferences`;

const addNonPreferenceFood = async (food: Food) => {
const response = await fetchWithToken.post(getAddNonPreferenceFoodPath(), {
food_id: food.food_id,
foodId: food.foodId,
});
return response.data;
};
Expand Down
2 changes: 1 addition & 1 deletion src/api/hooks/Food/useAddPreferenceFood.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const getAddPreferenceFoodPath = () => `${baseURL}/preferences`;

const addPreferenceFood = async (food: Food) => {
const response = await fetchWithToken.post(getAddPreferenceFoodPath(), {
food_id: food.food_id,
foodId: food.foodId,
});
return response.data;
};
Expand Down
4 changes: 2 additions & 2 deletions src/api/hooks/Food/useDeleteNonPreference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { baseURL, fetchWithToken } from '@/api/instance';

export const getDeleteNonPreferenceFoodPath = () => `${baseURL}/non-preferences`;

const deleteNonPreferenceFood = async (food_id: number) => {
const deleteNonPreferenceFood = async (foodId: number) => {
const response = await fetchWithToken.delete(getDeleteNonPreferenceFoodPath(), {
data: { food_id },
data: { foodId },
});
return response.data;
};
Expand Down
4 changes: 2 additions & 2 deletions src/api/hooks/Food/useDeletePreference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { baseURL, fetchWithToken } from '@/api/instance';

export const getDeletePreferenceFoodPath = () => `${baseURL}/preferences`;

const deletePreferenceFood = async (food_id: number) => {
const deletePreferenceFood = async (foodId: number) => {
const response = await fetchWithToken.delete(getDeletePreferenceFoodPath(), {
data: { food_id },
data: { foodId },
});
return response.data;
};
Expand Down
2 changes: 1 addition & 1 deletion src/api/hooks/Meeting/useGetMyMeetings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface Meeting {
title: string;
confirmedDateTime?: string | null;
confirmedFood: {
food_id: number;
foodId: number;
category: string;
name: string;
};
Expand Down
2 changes: 1 addition & 1 deletion src/api/hooks/Meeting/useGetRecommandMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useQuery } from '@tanstack/react-query';
import { baseURL, fetchWithToken } from '@/api/instance';

export interface Food {
food_id: number;
foodId: number;
category: string;
name: string;
}
Expand Down
72 changes: 36 additions & 36 deletions src/api/mock/food.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,17 @@ const PREFERENCE_FOOD_MOCK = {
status: 200,
message: '선호 음식 조회 성공',
data: [
{ food_id: 1001, category: '한식', name: '불고기' },
{ food_id: 2001, category: '양식', name: '스테이크' },
{ foodId: 1001, category: '한식', name: '불고기' },
{ foodId: 2001, category: '양식', name: '스테이크' },
],
};

const NON_PREFERENCE_FOOD_MOCK = {
status: 200,
message: '꺼려하는 음식 조회 성공',
data: [
{ food_id: 2003, category: '양식', name: '햄버거' },
{ food_id: 3002, category: '중식', name: '탕수육' },
{ foodId: 2003, category: '양식', name: '햄버거' },
{ foodId: 3002, category: '중식', name: '탕수육' },
],
};

Expand All @@ -136,37 +136,37 @@ const FOODS_BY_CATEGORY_MOCK = {
status: 200,
message: '음식 목록 조회 성공',
data: [
{ food_id: 1001, category: '한식', name: '불고기' },
{ food_id: 1002, category: '한식', name: '비빔밥' },
{ food_id: 1003, category: '한식', name: '김치찌개' },
{ food_id: 1004, category: '한식', name: '떡갈비' },
{ food_id: 1005, category: '한식', name: '콩나물 국밥' },
{ food_id: 1006, category: '한식', name: '파전' },
{ food_id: 1007, category: '한식', name: '갈비찜' },
{ food_id: 1008, category: '한식', name: '순두부찌개' },
{ food_id: 1009, category: '한식', name: '잡채' },
{ food_id: 1010, category: '한식', name: '삼계탕' },
{ food_id: 1011, category: '한식', name: '해장국' },
{ food_id: 2001, category: '양식', name: '스테이크' },
{ food_id: 2002, category: '양식', name: '파스타' },
{ food_id: 2003, category: '양식', name: '햄버거' },
{ food_id: 2004, category: '양식', name: '피자' },
{ food_id: 2005, category: '양식', name: '샌드위치' },
{ food_id: 2006, category: '양식', name: '라자냐' },
{ food_id: 2007, category: '양식', name: '리조또' },
{ food_id: 2008, category: '양식', name: '치킨 스튜' },
{ food_id: 3001, category: '중식', name: '짜장면' },
{ food_id: 3002, category: '중식', name: '탕수육' },
{ food_id: 4001, category: '일식', name: '초밥' },
{ food_id: 4002, category: '일식', name: '라멘' },
{ food_id: 5001, category: '카페,디저트', name: '커피' },
{ food_id: 5002, category: '카페,디저트', name: '케이크' },
{ food_id: 5003, category: '카페,디저트', name: '브라우니' },
{ food_id: 5004, category: '카페,디저트', name: '크레페' },
{ food_id: 5005, category: '카페,디저트', name: '와플' },
{ food_id: 6001, category: '술집', name: '맥주' },
{ food_id: 6002, category: '술집', name: '소주' },
{ food_id: 7001, category: '기타', name: '샐러드' },
{ food_id: 7002, category: '기타', name: '토스트' },
{ foodId: 1001, category: '한식', name: '불고기' },
{ foodId: 1002, category: '한식', name: '비빔밥' },
{ foodId: 1003, category: '한식', name: '김치찌개' },
{ foodId: 1004, category: '한식', name: '떡갈비' },
{ foodId: 1005, category: '한식', name: '콩나물 국밥' },
{ foodId: 1006, category: '한식', name: '파전' },
{ foodId: 1007, category: '한식', name: '갈비찜' },
{ foodId: 1008, category: '한식', name: '순두부찌개' },
{ foodId: 1009, category: '한식', name: '잡채' },
{ foodId: 1010, category: '한식', name: '삼계탕' },
{ foodId: 1011, category: '한식', name: '해장국' },
{ foodId: 2001, category: '양식', name: '스테이크' },
{ foodId: 2002, category: '양식', name: '파스타' },
{ foodId: 2003, category: '양식', name: '햄버거' },
{ foodId: 2004, category: '양식', name: '피자' },
{ foodId: 2005, category: '양식', name: '샌드위치' },
{ foodId: 2006, category: '양식', name: '라자냐' },
{ foodId: 2007, category: '양식', name: '리조또' },
{ foodId: 2008, category: '양식', name: '치킨 스튜' },
{ foodId: 3001, category: '중식', name: '짜장면' },
{ foodId: 3002, category: '중식', name: '탕수육' },
{ foodId: 4001, category: '일식', name: '초밥' },
{ foodId: 4002, category: '일식', name: '라멘' },
{ foodId: 5001, category: '카페,디저트', name: '커피' },
{ foodId: 5002, category: '카페,디저트', name: '케이크' },
{ foodId: 5003, category: '카페,디저트', name: '브라우니' },
{ foodId: 5004, category: '카페,디저트', name: '크레페' },
{ foodId: 5005, category: '카페,디저트', name: '와플' },
{ foodId: 6001, category: '술집', name: '맥주' },
{ foodId: 6002, category: '술집', name: '소주' },
{ foodId: 7001, category: '기타', name: '샐러드' },
{ foodId: 7002, category: '기타', name: '토스트' },
],
};
Loading