Skip to content

Commit

Permalink
NOISSUE - Fix rejected invitations query (#2433)
Browse files Browse the repository at this point in the history
Signed-off-by: WashingtonKK <[email protected]>
  • Loading branch information
WashingtonKK authored Sep 19, 2024
1 parent 67aee00 commit e611165
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions internal/api/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ func EncodeError(_ context.Context, err error, w http.ResponseWriter) {
w.WriteHeader(http.StatusNotFound)

case errors.Contains(err, errors.ErrStatusAlreadyAssigned),
errors.Contains(err, svcerr.ErrInvitationAlreadyRejected),
errors.Contains(err, svcerr.ErrInvitationAlreadyAccepted),
errors.Contains(err, svcerr.ErrConflict):
err = unwrap(err)
w.WriteHeader(http.StatusConflict)
Expand Down
2 changes: 1 addition & 1 deletion invitations/postgres/invitations.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func pageQuery(pm invitations.Page) string {
query = append(query, "confirmed_at IS NOT NULL")
}
if pm.State == invitations.Pending {
query = append(query, "confirmed_at IS NULL")
query = append(query, "confirmed_at IS NULL AND rejected_at IS NULL")
}
if pm.State == invitations.Rejected {
query = append(query, "rejected_at IS NOT NULL")
Expand Down

0 comments on commit e611165

Please sign in to comment.