Add submission page for uploads

* Closes: #13
This commit is contained in:
Las Zenow 2017-09-21 12:09:04 +00:00
parent 26894f1438
commit cc12981a50
12 changed files with 216 additions and 13 deletions

View file

@ -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 {