parent
26894f1438
commit
cc12981a50
12 changed files with 216 additions and 13 deletions
10
lib/admin.go
10
lib/admin.go
|
@ -34,6 +34,10 @@ func deleteHandler(h handler) {
|
|||
h.sess.Notify("Book not found!", "The book with id '"+id+"' is not there", "error")
|
||||
continue
|
||||
}
|
||||
err = h.db.UpdateSubmissionByBook(id, "Rejected", nil)
|
||||
if err != nil {
|
||||
log.Error("There was a problem updating the submission: ", err)
|
||||
}
|
||||
h.store.Delete(id)
|
||||
h.db.DeleteBook(id)
|
||||
|
||||
|
@ -216,6 +220,12 @@ func storeHandler(h handler) {
|
|||
log.Error("Error storing book '", book.Title, "': ", err.Error())
|
||||
continue
|
||||
}
|
||||
|
||||
err = h.db.UpdateSubmissionByBook(id, "Included in the library", &book)
|
||||
if err != nil {
|
||||
log.Error("There was a problem updating the submission: ", err)
|
||||
}
|
||||
|
||||
titles = append(titles, book.Title)
|
||||
}
|
||||
if titles != nil {
|
||||
|
|
Reference in a new issue