Skip to content

Commit

Permalink
fix: response 네이밍 변경된 것 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
Leejha committed Oct 11, 2023
1 parent ddd5461 commit 4fb7e76
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 19 deletions.
6 changes: 3 additions & 3 deletions apps/jurumarble/src/app/search/components/DrinkItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface Props {
}

function DrinkItem({ drinkInfo, onClickDrinkItem, selectedDrinkList }: Props) {
const { id, name, productName, image, enjoyCount } = drinkInfo;
const { id, name, manufacturer, image, enjoyCount, region } = drinkInfo;

const { colors } = useTheme();

Expand All @@ -40,9 +40,9 @@ function DrinkItem({ drinkInfo, onClickDrinkItem, selectedDrinkList }: Props) {
<SvgStamp width={24} height={24} fill={stampColor} />
</StampWrapper>
</NameStampContainer>
<ManufacturerName>{productName}</ManufacturerName>
<ManufacturerName>{manufacturer}</ManufacturerName>
<ChipContainer>
<Chip variant="region">서울</Chip>
<Chip variant="region">{region}</Chip>
<Chip variant="numberOfParticipants">{enjoyCount}명이 즐겼어요</Chip>
</ChipContainer>
</InfoContainer>
Expand Down
6 changes: 3 additions & 3 deletions apps/jurumarble/src/app/stamp/components/DrinkItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ interface Props {
| {
id: number;
name: string;
productName: string;
manufacturer: string;
image: string;
};
onClickReplaceDrinkInfo: (e: React.MouseEvent<HTMLButtonElement>) => void;
selectedDrinkList?: string[];
}

function DrinkItem({ drinkInfo, onClickReplaceDrinkInfo, selectedDrinkList }: Props) {
const { id, name, productName, image } = drinkInfo;
const { id, name, manufacturer, image } = drinkInfo;

const { colors } = useTheme();

Expand Down Expand Up @@ -48,7 +48,7 @@ function DrinkItem({ drinkInfo, onClickReplaceDrinkInfo, selectedDrinkList }: Pr
<SvgStamp width={24} height={24} fill={stampColor} />
</StampWrapper>
</NameStampContainer>
<ManufacturerName>{productName}</ManufacturerName>
<ManufacturerName>{manufacturer}</ManufacturerName>
</InfoContainer>
</Container>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ import SvgIcPrevious from "src/assets/icons/components/IcPrevious";
import { useRouter } from "next/navigation";
import { useMemo, useState } from "react";
import Image from "next/image";

import { DrinkInfoType } from "src/types/vote";
import { DrinkInfoType } from "src/types/drink";
import AorBMark from "components/AorBMark";

import TitleAndDescriptionSection from "app/vote/post/components/TitleAndDescriptionSection";
import PostBottomSheet from "app/vote/post/components/PostBottomSheet";
import DrinkSearchModal from "app/vote/post/components/DrinkSearchModal";
Expand Down
6 changes: 3 additions & 3 deletions apps/jurumarble/src/app/vote/post/components/DrinkItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Chip from "components/Chip";
import { transitions } from "lib/styles";
import Image from "next/image";
import { DrinkInfo } from "src/types/drink";
import { DrinkInfoType } from "src/types/vote";
import { DrinkInfoType } from "src/types/drink";
import styled, { css } from "styled-components";

interface Props {
Expand All @@ -12,7 +12,7 @@ interface Props {
}

function DrinkItem({ drinkInfo, onClickAddDrink, selectedDrinkList }: Props) {
const { name, productName, image } = drinkInfo;
const { name, manufacturer, image } = drinkInfo;

const isInclude = (selectedDrink: DrinkInfoType) => selectedDrink.id === drinkInfo.id;

Expand All @@ -25,7 +25,7 @@ function DrinkItem({ drinkInfo, onClickAddDrink, selectedDrinkList }: Props) {
<NameStampContainer>
<Name>{name}</Name>
</NameStampContainer>
<ManufacturerName>{productName}</ManufacturerName>
<ManufacturerName>{manufacturer}</ManufacturerName>
<ChipContainer>
<Chip variant="region">서울</Chip>
<Chip variant="numberOfParticipants">213명이 즐겼어요</Chip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SelectedDrinkChip from "./SelectedDrinkChip";
import DrinkItem from "app/vote/post/components/DrinkItem";
import SearchInput from "components/SearchInput";
import useInput from "hooks/useInput";
import { DrinkInfoType } from "src/types/vote";
import { DrinkInfoType } from "src/types/drink";
import useGetDrinkList from "../services/useGetDrinkList";
import RegionSelect from "./RegionSelect";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Image from "next/image";
import TitleAndDescriptionSection from "./TitleAndDescriptionSection";
import DrinkSearchModal from "./DrinkSearchModal";
import usePostVoteService from "../services/usePostVoteService";
import { DrinkInfoType } from "src/types/vote";
import { DrinkInfoType } from "src/types/drink";
import AorBMark from "components/AorBMark";
import { media } from "lib/styles";
import { SvgIcX, SvgInfo } from "src/assets/icons/components";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState } from "react";
import { DrinkInfoType } from "src/types/vote";
import { DrinkInfoType } from "src/types/drink";

export default function useUpdateSelectedDrinkList() {
const [selectedDrinkList, setDrinkList] = useState<DrinkInfoType[]>([]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { useMutation } from "@tanstack/react-query";
import { useRouter } from "next/navigation";
import { uploadImageAPI } from "lib/apis/common";
import { postDrinkVoteAPI, postNormalVoteAPI } from "lib/apis/vote";
import { DrinkInfoType, PostVoteType } from "src/types/vote";
import { PostVoteType } from "src/types/vote";
import Path from "lib/Path";
import { DrinkInfoType } from "src/types/drink";

export default function usePostVoteService() {
const router = useRouter();
Expand Down
4 changes: 3 additions & 1 deletion apps/jurumarble/src/types/drink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface DrinkInfo {
id: number;
name: string;
type: string;
productName: string;
manufacturer: string;
alcoholicBeverage: string;
rawMaterial: string;
capacity: string;
Expand All @@ -30,6 +30,8 @@ export interface DrinkInfo {
enjoyCount: number | null;
}

export type DrinkInfoType = Pick<DrinkInfo, "id" | "name" | "image">;

export interface DrinkMapInfo {
drinkId: number;
name: string;
Expand Down
2 changes: 0 additions & 2 deletions apps/jurumarble/src/types/vote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ export type PostVoteType = PostNormalVoteRequest & PostDrinkVoteRequest;
* @TODO 네이밍 변경 필요
*/

export type DrinkInfoType = Pick<DrinkInfo, "id" | "name" | "image">;

export interface Content {
voteId: number;
postedUserId: number;
Expand Down

0 comments on commit 4fb7e76

Please sign in to comment.