Skip to content

Commit

Permalink
added sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
elraphty committed May 30, 2024
1 parent fd13cf2 commit 08a5618
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions db/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (db database) GetFeaturesByWorkspaceUuid(uuid string, r *http.Request) []Wo
if sortBy != "" && direction != "" {
orderQuery = "ORDER BY " + sortBy + " " + direction
} else {
orderQuery = "ORDER BY created DESC"
orderQuery = "ORDER BY priority ASC"
}

if limit > 1 {
Expand Down Expand Up @@ -109,7 +109,7 @@ func (db database) CreateOrEditFeaturePhase(phase FeaturePhase) (FeaturePhase, e

func (db database) GetPhasesByFeatureUuid(featureUuid string) []FeaturePhase {
phases := []FeaturePhase{}
db.db.Model(&FeaturePhase{}).Where("feature_uuid = ?", featureUuid).Order("Created ASC").Find(&phases)
db.db.Model(&FeaturePhase{}).Where("feature_uuid = ?", featureUuid).Order("created ASC").Find(&phases)
return phases
}

Expand Down Expand Up @@ -153,7 +153,7 @@ func (db database) CreateOrEditFeatureStory(story FeatureStory) (FeatureStory, e

func (db database) GetFeatureStoriesByFeatureUuid(featureUuid string) ([]FeatureStory, error) {
var stories []FeatureStory
result := db.db.Where("feature_uuid = ?", featureUuid).Find(&stories)
result := db.db.Where("feature_uuid = ?", featureUuid).Order("priority ASC").Find(&stories)
if result.Error != nil {
return nil, result.Error
}
Expand Down

0 comments on commit 08a5618

Please sign in to comment.