finishes functionality for cart, checkout, return and renter registration
This commit is contained in:
@@ -17,7 +17,7 @@ func cors(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||
w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, PATCH, DELETE, OPTIONS")
|
||||
w.Header().Set("Access-Control-Allow_Headers", "Origin, Content-Type, Accept, Authorization")
|
||||
w.Header().Set("Access-Control-Allow-Headers", "Origin, Content-Type, Accept, Authorization")
|
||||
w.Header().Set("Access-Control-Allow-Credentials", "true")
|
||||
w.Header().Set("Access-Control-Max-Age", "600")
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package rental
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/gofrs/uuid"
|
||||
)
|
||||
|
||||
@@ -52,7 +50,6 @@ func (s *service) CheckoutBook(renterId uuid.UUID, title string) error {
|
||||
// If there was an error or the book is checked out by the renter already we'll
|
||||
// say the book is unavailable.
|
||||
if err != nil || checkedOut {
|
||||
fmt.Println("unavailable book", err, checkedOut)
|
||||
return ErrUnavailableBook
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user