Skip to content

Commit

Permalink
fix: http code if user already member in invite (#783)
Browse files Browse the repository at this point in the history
Service won't return 5xx if a user is already a member of
organization while creating the invite.

Signed-off-by: Kush Sharma <thekushsharma@gmail.com>
  • Loading branch information
kushsharma authored Sep 25, 2024
1 parent f0d6eea commit 03b036e
Show file tree
Hide file tree
Showing 14 changed files with 1,256 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ packages:
config:
dir: "core/organization/mocks"
all: true
github.com/raystack/frontier/core/invitation:
config:
dir: "core/invitation/mocks"
all: true
github.com/raystack/frontier/core/permission:
config:
dir: "core/permission/mocks"
Expand Down
5 changes: 3 additions & 2 deletions core/invitation/invite.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import (
)

var (
ErrNotFound = errors.New("invitation not found")
InviteExpired = errors.New("invitation expired")
ErrNotFound = errors.New("invitation not found")
ErrInviteExpired = errors.New("invitation expired")
ErrAlreadyMember = errors.New("user already exists in organization")
)

const (
Expand Down
206 changes: 206 additions & 0 deletions core/invitation/mocks/group_service.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 03b036e

Please sign in to comment.