Skip to content

Commit

Permalink
fix: get group return repeated result
Browse files Browse the repository at this point in the history
  • Loading branch information
icey-yu committed Nov 7, 2024
1 parent 3ebd1bb commit 8b627e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/common/storage/database/mgo/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (g *GroupMgo) Take(ctx context.Context, groupID string) (group *model.Group

func (g *GroupMgo) Search(ctx context.Context, keyword string, pagination pagination.Pagination) (total int64, groups []*model.Group, err error) {
// Define the sorting options
opts := options.Find().SetSort(bson.D{{Key: "created_at", Value: -1}})
opts := options.Find().SetSort(bson.D{{Key: "create_time", Value: -1}})

// Perform the search with pagination and sorting
return mongoutil.FindPage[*model.Group](ctx, g.coll, bson.M{
Expand Down

0 comments on commit 8b627e7

Please sign in to comment.