Skip to content

Commit

Permalink
Rewrite ReturnBorrowerBook handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-Giurgiu committed Oct 2, 2024
1 parent 9d5839d commit a7a8e6f
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,6 @@ func (app *App) ReturnBorrowedBook(w http.ResponseWriter, r *http.Request) {
return
}


_, err = app.DB.Exec("UPDATE books SET is_borrowed = FALSE WHERE id = ?", requestBody.BookID)
if err != nil {
app.Logger.Printf("Database error: %v", err)
Expand All @@ -1011,7 +1010,6 @@ func (app *App) ReturnBorrowedBook(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, `{"message": "Book returned successfully"}`)
}


// UpdateAuthor updates an existing author in the database
func (app *App) UpdateAuthor(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodPut && r.Method != http.MethodPost {
Expand Down

0 comments on commit a7a8e6f

Please sign in to comment.