finishes functionality for cart, checkout, return and renter registration

This commit is contained in:
David Lick
2020-05-31 23:25:49 -04:00
parent 28e52a4e08
commit 5cd92132b3
326 changed files with 495 additions and 16570 deletions
+1 -1
View File
@@ -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")
-3
View File
@@ -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
}