dete accounts
All checks were successful
Build and Push Docker Image / build_and_push (push) Successful in 2m1s

This commit is contained in:
Arnaud Delcasse
2026-01-13 15:33:38 +01:00
parent c958736472
commit 44f5a3d182
10 changed files with 221 additions and 28 deletions

View File

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