🐛 Fix lookup sticker via alias didn't preload attachment
This commit is contained in:
parent
525a103a76
commit
eabf0fdea1
@ -13,7 +13,8 @@ func GetStickerWithAlias(alias string) (models.Sticker, error) {
|
|||||||
prefix := viper.GetString("database.prefix")
|
prefix := viper.GetString("database.prefix")
|
||||||
if err := database.C.
|
if err := database.C.
|
||||||
Joins(fmt.Sprintf("LEFT JOIN %ssticker_packs pk ON pack_id = pk.id", prefix)).
|
Joins(fmt.Sprintf("LEFT JOIN %ssticker_packs pk ON pack_id = pk.id", prefix)).
|
||||||
Where("CONCAT(pk.prefix, alias) = ?", alias).First(&sticker).Error; err != nil {
|
Where("CONCAT(pk.prefix, alias) = ?", alias).
|
||||||
|
Preload("Attachment").First(&sticker).Error; err != nil {
|
||||||
return sticker, err
|
return sticker, err
|
||||||
}
|
}
|
||||||
return sticker, nil
|
return sticker, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user