Add tokenfield tag editor

This commit is contained in:
Las Zenow 2021-04-30 13:47:59 +00:00
parent 6a3da59c75
commit 02f711aa97
10 changed files with 148 additions and 3 deletions

View file

@ -33,6 +33,7 @@ type DB interface {
IncDownloads(ID string) error
GetDownloadCounter(ID string) (int, error)
GetFrontPage() FrontPage
GetTags() ([]string, error)
AddSubmission(submission Submission, userName string) (id int, err error)
UpdateSubmission(id int, status string, book *Book) error
UpdateSubmissionByBook(bookID string, status string, book *Book) error

View file

@ -109,6 +109,10 @@ func (db *roDB) GetFrontPage() FrontPage {
return db.db.GetFrontPage()
}
func (db *roDB) GetTags() ([]string, error) {
return db.db.GetTags()
}
func (db *roDB) AddSubmission(submission Submission, userName string) (id int, err error) {
return 0, errors.New("RO database")
}

View file

@ -96,6 +96,10 @@ func (db *pgDB) frontPageUpdater() {
}
}
func (db *pgDB) GetTags() ([]string, error) {
return db.frontPage.Tags, nil
}
func (db *pgDB) getVisitedBooks(num int) (books []Book, err error) {
err = db.sql.Model(&books).
Column("book.*").