2024-08-18 16:57:20 +00:00
|
|
|
package services
|
|
|
|
|
|
|
|
import (
|
2024-10-31 14:41:32 +00:00
|
|
|
"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"
|
|
|
|
)
|
|
|
|
|
2024-10-31 14:41:32 +00:00
|
|
|
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
|
|
|
}
|
2024-10-31 14:41:32 +00:00
|
|
|
return publisher, nil
|
2024-08-18 16:57:20 +00:00
|
|
|
}
|