✨ Realm directory
This commit is contained in:
@ -77,30 +77,6 @@ WHERE t.id IN (?)`, prefix, prefix, prefix), postIds).Scan(&reactInfo)
|
||||
}
|
||||
|
||||
func NewPost(
|
||||
user models.Account,
|
||||
alias, title, content string,
|
||||
attachments []models.Attachment,
|
||||
categories []models.Category,
|
||||
tags []models.Tag,
|
||||
publishedAt *time.Time,
|
||||
replyTo, repostTo *uint,
|
||||
) (models.Post, error) {
|
||||
return NewPostWithRealm(
|
||||
user,
|
||||
nil,
|
||||
alias,
|
||||
title,
|
||||
content,
|
||||
attachments,
|
||||
categories,
|
||||
tags,
|
||||
publishedAt,
|
||||
replyTo,
|
||||
repostTo,
|
||||
)
|
||||
}
|
||||
|
||||
func NewPostWithRealm(
|
||||
user models.Account,
|
||||
realm *models.Realm,
|
||||
alias, title, content string,
|
||||
|
@ -5,7 +5,16 @@ import (
|
||||
"code.smartsheep.studio/hydrogen/interactive/pkg/models"
|
||||
)
|
||||
|
||||
func ListRealms(user models.Account) ([]models.Realm, error) {
|
||||
func ListRealm() ([]models.Realm, error) {
|
||||
var realms []models.Realm
|
||||
if err := database.C.Find(&realms).Error; err != nil {
|
||||
return realms, err
|
||||
}
|
||||
|
||||
return realms, nil
|
||||
}
|
||||
|
||||
func ListRealmWithUser(user models.Account) ([]models.Realm, error) {
|
||||
var realms []models.Realm
|
||||
if err := database.C.Where(&models.Realm{AccountID: user.ID}).Find(&realms).Error; err != nil {
|
||||
return realms, err
|
||||
|
Reference in New Issue
Block a user