Skip to content

pulkit-khullar/TS-1

Repository files navigation

CAMERA STORE

REQUIREMENTS

  • List store inventory
  • User Login
  • User cart - accessible only after user login
  • get cart for specific user

ROUTES

  • /api/login Request Body

      POST
      {
        "username": "pulkit",
        "password": "pulkit"
      }
  • /api/register Request Body

      POST
      {
        "username": "pulkit",
        "password": "pulkit"
      }
  • /api/addInventory Request Body

      POST
      {
        "name": "name 2" ,
        "description": "description 2",
        "price": 1255,
        "make": 2001
      }
  • /api/getInventory Request Body

  POST
  {}
  • /api/getCart Request Body

      POST
      {}

    send the auth token in headers, token will be provided in response header of login

    auth-token:TOKEN

  • /api/cartOperations Request Body

      POST
      {
        "operation": "SUB",
        "productId": "5ee60151ea97389152022f24"
      }

    productid - get it from the getInvnetory result send the auth token in headers, token will be provided in response header of login

    auth-token:TOKEN

  • /api/cartOpearations Request Body

      POST
      {
        "operation": "ADD",
        "productId": "5ee60151ea97389152022f24"
      }

    productid - get it from the getInvnetory result send the auth token in headers, token will be provided in response header of login

    auth-token:TOKEN