fix: get group return repeated result (#2842)

dependabot/go_modules/github.com/golang-jwt/jwt/v4-4.5.1
icey-yu 1 week ago committed by GitHub
parent 3ebd1bbaa4
commit ad8ae5f5f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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{

Loading…
Cancel
Save