🔊 Add some logs in ListPostV2
🐛 Fix json tag
			
			
This commit is contained in:
		@@ -30,6 +30,6 @@ type Publisher struct {
 | 
			
		||||
	RealmID   *uint `json:"realm_id"`
 | 
			
		||||
	AccountID *uint `json:"account_id"`
 | 
			
		||||
 | 
			
		||||
	Account models.Account `gorm:"-" json:"realm"`
 | 
			
		||||
	Account models.Account `gorm:"-" json:"account"`
 | 
			
		||||
	Realm   models.Realm   `gorm:"-" json:"realm"`
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -11,6 +11,7 @@ import (
 | 
			
		||||
	fmodels "git.solsynth.dev/hypernet/paperclip/pkg/filekit/models"
 | 
			
		||||
	"git.solsynth.dev/hypernet/passport/pkg/authkit"
 | 
			
		||||
	amodels "git.solsynth.dev/hypernet/passport/pkg/authkit/models"
 | 
			
		||||
	"github.com/rs/zerolog/log"
 | 
			
		||||
	"github.com/samber/lo"
 | 
			
		||||
	"gorm.io/gorm"
 | 
			
		||||
)
 | 
			
		||||
@@ -111,6 +112,7 @@ func ListPostV2(tx *gorm.DB, take int, offset int, order any, user *uint) ([]mod
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Putting information back to data
 | 
			
		||||
	log.Info().Int("attachments", len(attachments)).Int("users", len(users)).Msg("Batch loaded metadata for listing post...")
 | 
			
		||||
	for idx, item := range posts {
 | 
			
		||||
		var this []fmodels.Attachment
 | 
			
		||||
		if val, ok := item.Body["attachments"].([]string); ok && len(val) > 0 {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user