Skip to content

Post Router

DongGyu Kim edited this page Aug 26, 2020 · 11 revisions

POST Posts (게시글 생성) /api/posts/

Headers

  • x-access-token

Body

  • title
  • description
  • is_public
  • user_id
  • image_id
  • category_id

GET Posts (모든 게시글 최신순 불러오기) /api/posts/

Query

  • page (default = 1)
  • limit (default = 10)

GET Posts (특정 게시글 불러오기) /api/posts/:id

Params

  • 불러오고자 하는 특정 post의 id

GET Posts (유저 전체 게시글 불러오기) /api/posts/user/:id

Params

  • user의 id

Query

  • page (default = 1)
  • limit (default = 10)

GET Posts (카테고리별 게시글 가져오기) /api/posts/category/:id

Params

  • category의 id

Query

  • page (default = 1)
  • limit (default = 10)

GET Posts (해당 카테고리에 상속된 모든 게시글 가져오기) /api/posts/category/all/:id

Params

  • category의 id

PUT Post (게시글 수정) /api/posts/:id

Params

  • 수정하고자 하는 post의 id

Headers

  • x-access-token

Body

  • title
  • description
  • is_public
  • category_id

DELETE Post (게시글 삭제) /api/posts/:id

Params

  • 삭제하고자 하는 post의 id

Headers

  • x-access-token

Clone this wiki locally