chore(avs): minor improve avs debugging printout

This commit is contained in:
Steffen Jost 2022-12-14 16:05:03 +01:00
parent 2163ed96d0
commit df1a816d83
2 changed files with 49 additions and 42 deletions

View File

@ -113,8 +113,12 @@ postAdminAvsR = do
addMessage Info $ text2Html $ "Query: " <> tshow (toJSON fr)
res <- avsQueryPerson fr
case res of
Left err -> return . Just $ tshow err
Right jsn -> return . Just $ Text.replace "},Avs" "},\n Avs" $ tshow jsn
Left err -> let msg = tshow err in return $ Just [whamlet|<h2>Error:</h2> #{msg}|]
Right (AvsResponsePerson pns) -> return $ Just [whamlet|
<ul>
$forall p <- pns
<li>#{tshow p}
|]
mbPerson <- formResultMaybe presult procFormPerson
((sresult, swidget), senctype) <- runFormPost $ makeAvsStatusForm Nothing
@ -122,8 +126,12 @@ postAdminAvsR = do
addMessage Info $ text2Html $ "Query: " <> tshow (toJSON fr)
res <- avsQueryStatus fr
case res of
Left err -> return . Just $ tshow err
Right jsn -> return . Just $ Text.replace "},Avs" "},\n Avs" $ tshow jsn
Left err -> let msg = tshow err in return $ Just [whamlet|<h2>Error:</h2> #{msg}|]
Right (AvsResponseStatus pns) -> return $ Just [whamlet|
<ul>
$forall p <- pns
<li>#{tshow p}
|]
mbStatus <- formResultMaybe sresult procFormStatus
((crUsrRes, crUsrWgt), crUsrEnctype) <- runFormPost $ identifyForm FIDAvsCreateUser $ \html ->
@ -323,4 +331,3 @@ getProblemAvsSynchR = do
setTitleI MsgAvsTitleLicenceSynch
$(i18nWidgetFile "avs-synchronisation")

View File

@ -43,7 +43,7 @@ $# SPDX-License-Identifier: AGPL-3.0-or-later
$maybe answer <- mbPerson
<p>
Unverarbeitete Antwort: #
#{answer}
^{answer}
<section>
<p>
@ -52,4 +52,4 @@ $# SPDX-License-Identifier: AGPL-3.0-or-later
$maybe answer <- mbStatus
<p>
Unverarbeitete Antwort: #
#{answer}
^{answer}