fix delivery endpoint
All checks were successful
Build and Publish / BuildAndDeploy (push) Successful in 1m52s
All checks were successful
Build and Publish / BuildAndDeploy (push) Successful in 1m52s
This commit is contained in:
@@ -2,7 +2,6 @@ package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
@@ -85,14 +84,11 @@ type SetDelivery struct {
|
||||
|
||||
func (s *PoolServer) HandleSetDelivery(w http.ResponseWriter, r *http.Request) error {
|
||||
id := r.PathValue("id")
|
||||
var delivery *SetDelivery
|
||||
err := json.NewDecoder(r.Body).Decode(delivery)
|
||||
delivery := SetDelivery{}
|
||||
err := json.NewDecoder(r.Body).Decode(&delivery)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if delivery == nil {
|
||||
return fmt.Errorf("no delivery data")
|
||||
}
|
||||
data, err := s.pool.Process(ToCartId(id), Message{
|
||||
Type: SetDeliveryType,
|
||||
Content: &messages.SetDelivery{
|
||||
|
||||
Reference in New Issue
Block a user