mirror of
https://github.com/absmach/supermq.git
synced 2026-06-23 07:20:19 +00:00
NOISSUE - Fix rejected invitations query (#2433)
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
This commit is contained in:
committed by
GitHub
parent
67aee00dc4
commit
e611165fc8
@@ -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)
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user