🐛 Fix metadata wont preload author
This commit is contained in:
parent
0f1c787137
commit
6055ca4274
@ -26,7 +26,7 @@ func GetAttachmentByID(id uint) (models.Attachment, error) {
|
|||||||
var attachment models.Attachment
|
var attachment models.Attachment
|
||||||
if err := database.C.Where(models.Attachment{
|
if err := database.C.Where(models.Attachment{
|
||||||
BaseModel: models.BaseModel{ID: id},
|
BaseModel: models.BaseModel{ID: id},
|
||||||
}).First(&attachment).Error; err != nil {
|
}).Preload("Account").First(&attachment).Error; err != nil {
|
||||||
return attachment, err
|
return attachment, err
|
||||||
} else {
|
} else {
|
||||||
if len(metadataCache) > metadataCacheLimit {
|
if len(metadataCache) > metadataCacheLimit {
|
||||||
|
Loading…
Reference in New Issue
Block a user