NOISSUE - Fix rejected invitations query (#2433)

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
This commit is contained in:
Washington Kigani Kamadi
2024-09-19 22:41:32 +03:00
committed by GitHub
parent 67aee00dc4
commit e611165fc8
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -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)
+1 -1
View File
@@ -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")