commit c4f86ebdfb9519cbb3dc4892ff0a46860561e1a9
parent b91039da73c5df5cc4842c5ea9143c74497528c0
Author: Joel-Haeberli <haebu@rubigen.ch>
Date: Wed, 8 May 2024 15:32:32 +0200
fix: status code
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/c2ec/api-bank-integration.go b/c2ec/api-bank-integration.go
@@ -199,6 +199,9 @@ func handleWithdrawalStatus(res http.ResponseWriter, req *http.Request) {
if err != nil {
LogError("bank-integration-api", err)
}
+ if withdrawal == nil {
+ return
+ }
if withdrawal.WithdrawalStatus != oldState {
withdrawalAlreadyChanged <- withdrawal
}
@@ -284,7 +287,7 @@ func writeWithdrawalOrError(wopid []byte, res http.ResponseWriter) {
withdrawal, err := DB.GetWithdrawalByWopid(wopid)
if err != nil {
LogError("bank-integration-api", err)
- res.WriteHeader(HTTP_INTERNAL_SERVER_ERROR)
+ res.WriteHeader(HTTP_NOT_FOUND)
return
}