handleRejectCSR :: AppState -> ActionM ()
handleRejectCSR state = do
  csrId <- param "csrid"
  updatedCsr <- update' state $ RejectCSR csrId
  case updatedCsr of
    Nothing -> serveError notFound404 "Could not find CSR"
    (Just csr) -> json csr

-- Returns a reason if signing is not possible, and Nothing otherwise.
handleRejectCSR :: AppState -> ActionM ()
handleRejectCSR state = do
  csrId <- param "csrid"
  updatedCsr <- update' state $ RejectCSR csrId
  case updatedCsr of
    Nothing -> serveError notFound404 "Could not find CSR"
    (Just csr) -> json csr

-- Returns a reason if signing is not possible, and Nothing otherwise.
handleRejectCSR state = do
  csrId <- param "csrid"
  updatedCsr <- update' state $ RejectCSR csrId
  case updatedCsr of
    Nothing -> serveError notFound404 "Could not find CSR"
    (Just csr) -> json csr

-- Returns a reason if signing is not possible, and Nothing otherwise.