Skip to content

Commit

Permalink
fix: update user (#586)
Browse files Browse the repository at this point in the history
  • Loading branch information
icey-yu authored Oct 18, 2024
1 parent b704948 commit e00aef8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/common/db/model/chat/credential.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ package chat

import (
"context"
"go.mongodb.org/mongo-driver/mongo/options"

"github.com/openimsdk/chat/pkg/common/db/table/chat"
"github.com/openimsdk/tools/db/mongoutil"
"github.com/openimsdk/tools/db/pagination"
"github.com/openimsdk/tools/errs"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
)

func NewCredential(db *mongo.Database) (chat.CredentialInterface, error) {
Expand Down Expand Up @@ -128,6 +127,9 @@ func (o *Credential) Delete(ctx context.Context, userIDs []string) error {
}

func (o *Credential) DeleteByUserIDType(ctx context.Context, credentials ...*chat.Credential) error {
if len(credentials) == 0 {
return nil
}
var filters []bson.M
for _, credential := range credentials {
filters = append(filters, bson.M{
Expand Down

0 comments on commit e00aef8

Please sign in to comment.