Fix the check if the book is active

This commit is contained in:
Las Zenow 2021-04-30 14:26:40 +00:00
parent 06a522231d
commit 836a71b2d0

View file

@ -159,7 +159,7 @@ func (db *pgDB) ActiveBook(id string) error {
func (db *pgDB) IsBookActive(id string) bool { func (db *pgDB) IsBookActive(id string) bool {
var active []bool var active []bool
err := db.sql.Model(&Book{}). err := db.sql.Model(&Book{}).
Relation("active"). Column("active").
Where("id = ?", id). Where("id = ?", id).
Select(&active) Select(&active)
if err != nil || len(active) != 1 { if err != nil || len(active) != 1 {