dete accounts
All checks were successful
Build and Push Docker Image / build_and_push (push) Successful in 2m1s
All checks were successful
Build and Push Docker Image / build_and_push (push) Successful in 2m1s
This commit is contained in:
@@ -193,6 +193,20 @@ func (s MongoDBStorage) UpdateAccount(account Account) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s MongoDBStorage) DeleteAccount(id string) error {
|
||||
collection := s.Client.Database(s.DbName).Collection(s.Collections["users"])
|
||||
update := bson.M{
|
||||
"$set": bson.M{"deleted": true},
|
||||
"$unset": bson.M{"authentication": ""},
|
||||
}
|
||||
if _, err := collection.UpdateOne(context.TODO(), bson.M{"_id": id}, update); err != nil {
|
||||
log.Error().Err(err).Msg("")
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s MongoDBStorage) Migrate() error {
|
||||
log.Error().Msg("no migration")
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user