List boosts by attachment

This commit is contained in:
2024-12-28 22:08:45 +08:00
parent b73f5e1912
commit 1a5787d3c2
3 changed files with 27 additions and 7 deletions

View File

@ -13,6 +13,14 @@ import (
"github.com/spf13/viper"
)
func ListBoostByAttachment(attachmentId uint) ([]models.AttachmentBoost, error) {
var boosts []models.AttachmentBoost
if err := database.C.Where("attachment_id = ?", attachmentId).Find(&boosts).Error; err != nil {
return boosts, err
}
return boosts, nil
}
func GetBoostByID(id uint) (models.AttachmentBoost, error) {
var boost models.AttachmentBoost
if err := database.C.