From cf5b0a8440833ea432352e4ab8b1cd31f92371f4 Mon Sep 17 00:00:00 2001 From: Josh Freda Date: Thu, 9 Nov 2023 10:56:14 -0600 Subject: [PATCH] Allow approving documents in Approved status (#415) --- internal/api/approvals.go | 4 ++-- internal/api/v2/approvals.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/api/approvals.go b/internal/api/approvals.go index 0364be968..b56aa6e99 100644 --- a/internal/api/approvals.go +++ b/internal/api/approvals.go @@ -354,9 +354,9 @@ func ApprovalHandler( // Authorize request. userEmail := r.Context().Value("userEmail").(string) - if doc.Status != "In-Review" && doc.Status != "In Review" { + if doc.Status != "In-Review" && doc.Status != "Approved" { http.Error(w, - "Only documents in the \"In-Review\" status can be approved", + `Document status must be "In-Review" or "Approved" to approve`, http.StatusBadRequest) return } diff --git a/internal/api/v2/approvals.go b/internal/api/v2/approvals.go index 16e0075c7..2ce210dc8 100644 --- a/internal/api/v2/approvals.go +++ b/internal/api/v2/approvals.go @@ -390,9 +390,9 @@ func ApprovalsHandler(srv server.Server) http.Handler { // Authorize request. userEmail := r.Context().Value("userEmail").(string) - if doc.Status != "In-Review" && doc.Status != "In Review" { + if doc.Status != "In-Review" && doc.Status != "Approved" { http.Error(w, - "Only documents in the \"In-Review\" status can be approved", + `Document status must be "In-Review" or "Approved" to approve`, http.StatusBadRequest) return }