Skip to content

Commit

Permalink
- ajout de méthodes pour simplifier la signature d'AddMemberToCard et…
Browse files Browse the repository at this point in the history
… RemoveMemberFromCard dans le cas d'un ajout d'un membre par lui même
  • Loading branch information
Christophe Ninucci committed Dec 7, 2023
1 parent af63ce0 commit b18405d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions users.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,10 @@ func (wekan *Wekan) DisableUsers(ctx context.Context, users Users) error {
return nil
}

func (wekan *Wekan) RemoveSelfMemberFromCard(ctx context.Context, card Card, member User) error {
return wekan.RemoveMemberFromCard(ctx, card, member, member)
}

func (wekan *Wekan) RemoveMemberFromCard(ctx context.Context, card Card, user User, member User) error {
if err := wekan.AssertPrivileged(ctx); err != nil {
return err
Expand Down Expand Up @@ -505,6 +509,10 @@ func (wekan *Wekan) EnsureMemberOutOfCard(ctx context.Context, card Card, user U
return err == nil, err
}

func (wekan *Wekan) AddSelfMemberToCard(ctx context.Context, card Card, member User) error {
return wekan.AddMemberToCard(ctx, card, member, member)
}

func (wekan *Wekan) AddMemberToCard(ctx context.Context, card Card, user User, member User) error {
if err := wekan.AssertPrivileged(ctx); err != nil {
return err
Expand Down

0 comments on commit b18405d

Please sign in to comment.