Skip to content

Commit

Permalink
Allow approving documents in Approved status (#415)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfreda authored Nov 9, 2023
1 parent 2f39473 commit cf5b0a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/api/approvals.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions internal/api/v2/approvals.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit cf5b0a8

Please sign in to comment.