🗃️ Realm popularity field & sorting communities according to it
This commit is contained in:
parent
a2d033b56c
commit
bac655c1cf
@ -15,6 +15,7 @@ type Realm struct {
|
||||
Members []RealmMember `json:"members"`
|
||||
Avatar *string `json:"avatar"`
|
||||
Banner *string `json:"banner"`
|
||||
Popularity int `json:"popularity"`
|
||||
AccessPolicy datatypes.JSONMap `json:"access_policy"`
|
||||
IsPublic bool `json:"is_public"`
|
||||
IsCommunity bool `json:"is_community"`
|
||||
|
@ -15,7 +15,7 @@ func ListCommunityRealm() ([]models.Realm, error) {
|
||||
var realms []models.Realm
|
||||
if err := database.C.Where(&models.Realm{
|
||||
IsCommunity: true,
|
||||
}).Find(&realms).Error; err != nil {
|
||||
}).Order("popularity DESC").Find(&realms).Error; err != nil {
|
||||
return realms, err
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user