update to pointer
This commit is contained in:
@@ -9,30 +9,28 @@ Content-Type: application/json
|
|||||||
}
|
}
|
||||||
|
|
||||||
### Update quanity of item in cart
|
### Update quanity of item in cart
|
||||||
PUT https://cart.tornberg.me/api/12345/1
|
PUT https://cart.tornberg.me/api/12345
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
|
|
||||||
{
|
{
|
||||||
|
"id": 1,
|
||||||
"quantity": 1
|
"quantity": 1
|
||||||
}
|
}
|
||||||
|
|
||||||
### Add item to cart
|
### Delete item from cart
|
||||||
POST http://localhost:8080/cart/12345/item
|
DELETE https://cart.tornberg.me/api/12345/1
|
||||||
|
|
||||||
|
|
||||||
|
### Set delivery
|
||||||
|
|
||||||
|
POST https://cart.tornberg.me/api/12345/delivery
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
|
|
||||||
{
|
{
|
||||||
"itemId": "67890",
|
"provider": "postnord",
|
||||||
"quantity": 2
|
"items": [
|
||||||
}
|
|
||||||
|
|
||||||
### Remove item from cart
|
|
||||||
DELETE http://localhost:8080/cart/12345/item/67890
|
|
||||||
|
|
||||||
### Checkout cart
|
|
||||||
POST http://localhost:8080/cart/12345/checkout
|
|
||||||
Content-Type: application/json
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"paymentMethod": "credit_card",
|
"id": 1,
|
||||||
"shippingAddress": "123 Main St, Anytown, USA"
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
@@ -172,7 +172,7 @@ func (s *PoolServer) HandleQuantityChange(w http.ResponseWriter, r *http.Request
|
|||||||
}
|
}
|
||||||
reply, err := s.pool.Process(ToCartId(id), Message{
|
reply, err := s.pool.Process(ToCartId(id), Message{
|
||||||
Type: ChangeQuantityType,
|
Type: ChangeQuantityType,
|
||||||
Content: changeQuantity,
|
Content: &changeQuantity,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user