Add ISBN to the metadata editor
This commit is contained in:
parent
0f627dcd53
commit
fcf9b1eb8d
2 changed files with 9 additions and 0 deletions
|
@ -9,6 +9,7 @@ import (
|
|||
|
||||
"github.com/gorilla/mux"
|
||||
"gitlab.com/trantor/trantor/lib/database"
|
||||
"gitlab.com/trantor/trantor/lib/parser"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -94,6 +95,7 @@ func saveHandler(h handler) {
|
|||
description := h.r.FormValue("description")
|
||||
author := cleanEmptyStr(h.r.Form["author"])
|
||||
subject := cleanEmptyStr(h.r.Form["subject"])
|
||||
isbn := parser.ISBN(h.r.FormValue("isbn")) // XXX: check for errors
|
||||
lang := cleanEmptyStr(h.r.Form["lang"])
|
||||
book := map[string]interface{}{"title": title,
|
||||
"publisher": publisher,
|
||||
|
@ -101,6 +103,7 @@ func saveHandler(h handler) {
|
|||
"description": description,
|
||||
"author": author,
|
||||
"subject": subject,
|
||||
"isbn": isbn,
|
||||
"lang": lang}
|
||||
err := h.db.UpdateBook(id, book)
|
||||
if err != nil {
|
||||
|
|
Reference in a new issue