Interactive/pkg/internal/services/publishers.go

16 lines
463 B
Go
Raw Normal View History

2024-08-18 16:57:20 +00:00
package services
import (
"fmt"
2024-08-18 16:57:20 +00:00
"git.solsynth.dev/hydrogen/interactive/pkg/internal/database"
"git.solsynth.dev/hydrogen/interactive/pkg/internal/models"
)
func GetPublisher(id uint, userID uint) (models.Publisher, error) {
var publisher models.Publisher
if err := database.C.Where("id = ? AND account_id = ?", id, userID).First(&publisher).Error; err != nil {
return publisher, fmt.Errorf("unable to get publisher: %v", err)
2024-08-18 16:57:20 +00:00
}
return publisher, nil
2024-08-18 16:57:20 +00:00
}