chore: update book enabled status wiring
This commit is contained in:
@@ -14,7 +14,7 @@ func (s *BookAuthorService) CreateBookAuthor(item book.BookAuthor) error {
|
||||
if err := validateBookAuthor(item); err != nil {
|
||||
return err
|
||||
}
|
||||
return global.GVA_DB.Create(&item).Error
|
||||
return global.GVA_DB.Save(&item).Error
|
||||
}
|
||||
|
||||
func (s *BookAuthorService) DeleteBookAuthor(item book.BookAuthor) error {
|
||||
@@ -45,8 +45,8 @@ func (s *BookAuthorService) GetBookAuthorInfoList(info bookReq.BookAuthorSearch)
|
||||
if info.Keyword != "" {
|
||||
db = db.Where("name LIKE ?", "%"+info.Keyword+"%")
|
||||
}
|
||||
if info.AuthorStatus != "" {
|
||||
db = db.Where("author_status = ?", info.AuthorStatus)
|
||||
if info.IsEnabled != nil {
|
||||
db = db.Where("is_enabled = ?", *info.IsEnabled)
|
||||
}
|
||||
err = db.Count(&total).Error
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user