Skip to content

Commit

Permalink
feat(catalog): order asc in create time (#80)
Browse files Browse the repository at this point in the history
Because

supprot order asc in create time

This commit

add order when retrieving catalog files
  • Loading branch information
Yougigun authored Aug 20, 2024
1 parent f1e2505 commit 98348e9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/repository/knowledgebasefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ func (r *Repository) ListKnowledgeBaseFiles(ctx context.Context, uid string, own
query = query.Where(whereClause, kbfs[0].CreateTime)
}

// Order by create time
query = query.Order(fmt.Sprintf("%v ASC", KnowledgeBaseFileColumn.CreateTime))

// Fetch the records
if err := query.Find(&kbs).Error; err != nil {
return nil, 0, "", err
Expand Down

0 comments on commit 98348e9

Please sign in to comment.