-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: Gathering 타입 정의 및 지역 상수 추가 #51
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import type { Region } from "#/types/gathering"; | ||
|
|
||
| export interface RegionOption { | ||
|
||
| id: NonNullable<Region>; | ||
| label: string; | ||
| } | ||
|
|
||
| export const REGION_OPTIONS: RegionOption[] = [ | ||
| { | ||
| id: "HONGDAE", | ||
| label: "홍대입구역", | ||
| }, | ||
| { | ||
| id: "GANGNAM", | ||
| label: "강남역", | ||
| }, | ||
| ] as const; | ||
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -23,17 +23,21 @@ export type FoodCategory = | |||||||||||||||||||||||||||||||||||||||||||||
| export type RankKey = "first" | "second" | "third"; | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| export interface OpinionForm { | ||||||||||||||||||||||||||||||||||||||||||||||
| distanceRange?: DistanceRange; | ||||||||||||||||||||||||||||||||||||||||||||||
| distanceRange: DistanceRange; | ||||||||||||||||||||||||||||||||||||||||||||||
| dislikedFoods: FoodCategory[]; | ||||||||||||||||||||||||||||||||||||||||||||||
| preferredMenus: { | ||||||||||||||||||||||||||||||||||||||||||||||
| first?: FoodCategory; | ||||||||||||||||||||||||||||||||||||||||||||||
| second?: FoodCategory; | ||||||||||||||||||||||||||||||||||||||||||||||
| third?: FoodCategory; | ||||||||||||||||||||||||||||||||||||||||||||||
| first: FoodCategory; | ||||||||||||||||||||||||||||||||||||||||||||||
| second: FoodCategory; | ||||||||||||||||||||||||||||||||||||||||||||||
| third: FoodCategory; | ||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
| export interface OpinionForm { | |
| distanceRange?: DistanceRange; | |
| distanceRange: DistanceRange; | |
| dislikedFoods: FoodCategory[]; | |
| preferredMenus: { | |
| first?: FoodCategory; | |
| second?: FoodCategory; | |
| third?: FoodCategory; | |
| first: FoodCategory; | |
| second: FoodCategory; | |
| third: FoodCategory; | |
| }; | |
| } | |
| export type OpinionForm = { | |
| distanceRange: DistanceRange; | |
| dislikedFoods: FoodCategory[]; | |
| preferredMenus: { | |
| first: FoodCategory; | |
| second: FoodCategory; | |
| third: FoodCategory; | |
| }; | |
| }; |
References
- 스타일 가이드에서는 Props 정의에
interface보다type을 선호한다고 명시되어 있습니다. 일관성을 위해 다른 타입 정의에도 이 규칙을 적용하는 것이 좋습니다. (link)
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mock API 구현을 위해 임시로 정의했던 Interface 에 대해서 Deprecated 라벨 부착
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분은 현재 운영에 merge 할 때 conflict 날수 있음 !