Skip to content

Redux (상태 트리의) 구조에 대한 논의 #29

@seongbin9786

Description

@seongbin9786
  1. 이 서비스에서 공유하는 정보는 크게 Token, Store, Menu, Category, Cart, Order가 있습니다.

  2. 원격 API 호출은 비동기 액션이므로 '시작', '성공', '실패' 별로 액션/리듀서가 있는 게 적절하지만 저희가 이번 주에 도입할 지는 잘 모르겠습니다 🔨 (예) redux-promise-middleware, redux-pender

Token

- 토큰 발행
- 토큰 확인
- 토큰 리프레시
- 매 최초 접속 시 정상적인 토큰이 발급되어야 함
- 로딩 페이지에서 처리
    - 이후 axios를 사용하더라도 Token에 관련된 정보는 관여하지 않도록

Store - 현재 온전하지 않음(...)

shopId
shopName
shopImagePath`(예상 데이터)

Menu

menuId
categoryId
name
comment
imagePath
price
options (Array)
    optionId
    name
    price

Category

categoryId
categoryName

Cart

- API가 있지 않음
- Redux에서 내부적으로 처리함
- 해당 정보는 주문 API 호출(아래) 시 사용됨
- 새로고침 등에 대비해서 local storage를 사용해야 할 수도 있음

Order

userId
totalPrice
shopId
seatNumber
items (Array)
    {
        itemName
        itemOptions (Array)
            itemOptionName
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionDiscussion for issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions