Routes - Favourite

File Name : favourite.js
File Path : /server/routes/favourite.js
Favourite route contains createFavourite and getFavourite . These functionalities are included in Favourite Controller.

Create Favourite Restaurant Route

  1. API Path: api/favourite/setFavourite
  2. Method: POST
    1. Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
  3. Parameters:

    • Name: req
    • Type: Object
    Name In Type
    resId req.body string
    • Name: res
    • Type: Object
    • Description: res is nothing but the response object which you save favourite restaurant and gets it to user.
  4. Response:

    • Http Code: 200
    • Name: returnObj
    • Type: Object
    Name Type
    success boolean
    message string
    data object

Get Favourite Restaurant Route

  1. API Path: api/favourite/getFavourite
  2. Method: GET
  3. Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
  4. Parameters:

    • Name: req
    • Type: Object

    • Name: jwtAccessToken

    • In: Header
    • Type: String
    • Description: JWT access token is used to check the authenticity of the user.
  • Name: res

    • Type: Object
    • Description: res is nothing but the response object which gets you the favourite restaurant details.
  • Response:

    • Http Code: 200
    • Name: returnObj
    • Type: Object
    Name Type
    success boolean
    message string
    data array

results matching ""

    No results matching ""