Add delete option
All checks were successful
Build and Push Docker Image / build_and_push (push) Successful in 1m57s
All checks were successful
Build and Push Docker Image / build_and_push (push) Successful in 1m57s
This commit is contained in:
@@ -152,6 +152,16 @@ func (s MongoDBStorage) UpdateGroup(group Group) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s MongoDBStorage) DeleteGroup(id string) error {
|
||||
collection := s.Client.Database(s.DbName).Collection(s.Collections["groups"])
|
||||
|
||||
if _, err := collection.DeleteOne(context.TODO(), bson.M{"_id": id}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
/*********************************************************************************************************************************/
|
||||
/*********************************************************Code********************************************************************/
|
||||
/*********************************************************************************************************************************/
|
||||
|
||||
@@ -12,6 +12,7 @@ type Storage interface {
|
||||
GetGroups([]string) ([]Group, error)
|
||||
GetGroupsByIds([]string) ([]Group, error)
|
||||
UpdateGroup(Group) error
|
||||
DeleteGroup(string) error
|
||||
/*******************************************************/
|
||||
CreateGroupMember(GroupMember) error
|
||||
GetGroupMember(string) (*GroupMember, error)
|
||||
|
||||
Reference in New Issue
Block a user