diff --git a/pkg/handler/crud.go b/pkg/handler/crud.go index d1705722..7de12f03 100644 --- a/pkg/handler/crud.go +++ b/pkg/handler/crud.go @@ -173,7 +173,7 @@ func (c *crud) GetFlagSnapshots(params flag.GetFlagSnapshotsParams) middleware.R func (c *crud) GetFlagEntityTypes(params flag.GetFlagEntityTypesParams) middleware.Responder { entityTypes := []entity.FlagEntityType{} - if err := getDB().Order("key ASC").Find(&entityTypes).Error; err != nil { + if err := entity.NewFlagEntityTypeQuerySet(getDB()).All(&entityTypes); err != nil { return flag.NewGetFlagEntityTypesDefault(500).WithPayload( ErrorMessage("cannot find flag entity types. err:%s", err))