From 837e180995417fc25e1e936af9f48f34f54c5173 Mon Sep 17 00:00:00 2001 From: cindy Date: Sun, 12 Feb 2023 16:24:12 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20post=20->=20create=20=EB=84=A4?= =?UTF-8?q?=EC=9D=B4=EB=B0=8D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/review/index.ts | 2 +- src/pages/reviews/create/[beerId].page.tsx | 2 +- .../ReviewDetailContainer/ReviewDetailContainer.tsx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/apis/review/index.ts b/src/apis/review/index.ts index b4760d4..dc52db8 100644 --- a/src/apis/review/index.ts +++ b/src/apis/review/index.ts @@ -49,7 +49,7 @@ export interface ICreateReviewPayload { flavorIds: number[]; } -export const postReview = async (payload: ICreateReviewPayload) => { +export const createReview = async (payload: ICreateReviewPayload) => { const res = await request({ method: 'post', url: '/api/v1/reviews', diff --git a/src/pages/reviews/create/[beerId].page.tsx b/src/pages/reviews/create/[beerId].page.tsx index 691bba9..3a7484b 100644 --- a/src/pages/reviews/create/[beerId].page.tsx +++ b/src/pages/reviews/create/[beerId].page.tsx @@ -3,7 +3,7 @@ import { NextPage, GetServerSideProps } from 'next'; import { RecoilRoot } from 'recoil'; import { getBeer } from '@/apis/beers/getBeer'; -import { getReview, postReview } from '@/apis/review'; +import { getReview, createReview } from '@/apis/review'; import Header, { HEADER_HEIGHT } from '@/components/Header'; import { BackButton } from '@/components/Header/extras'; import SwiperLayout from '@/components/layouts/SwiperLayout'; diff --git a/src/pages/reviews/create/components/ReviewDetailContainer/ReviewDetailContainer.tsx b/src/pages/reviews/create/components/ReviewDetailContainer/ReviewDetailContainer.tsx index 5216a4d..6b2484f 100644 --- a/src/pages/reviews/create/components/ReviewDetailContainer/ReviewDetailContainer.tsx +++ b/src/pages/reviews/create/components/ReviewDetailContainer/ReviewDetailContainer.tsx @@ -6,7 +6,7 @@ import { useMutation } from 'react-query'; import { useRecoilValue } from 'recoil'; import { useGetFlavors } from '@/apis/flavors'; -import { ICreateReviewPayload, postReview, uploadImage } from '@/apis/review'; +import { ICreateReviewPayload, createReview, uploadImage } from '@/apis/review'; import BottomFloatingButtonArea from '@/components/BottomFloatingButtonArea'; import { BOTTOM_FLOATING_BUTTON_AREA_HEIGHT } from '@/components/BottomFloatingButtonArea/BottomFloatingButtonArea'; import Button, { ButtonCount } from '@/components/Button'; @@ -39,7 +39,7 @@ const ReviewDetailContainer: React.FC = ({ const reviewForm = useRecoilValue($reviewForm); const { data: flavors } = useGetFlavors(); const { mutateAsync: uploadImageMutation } = useMutation(uploadImage); - const { mutateAsync: createReviewMutation } = useMutation(postReview); + const { mutateAsync: createReviewMutation } = useMutation(createReview); // const { mutateAsync: updateRecordMutation } = useMutation(updateRecord, { // onSuccess: () => { // router.back();