From b1e9a6cc7c670f64a9fab0f9b4c45bb1c0ee0773 Mon Sep 17 00:00:00 2001
From: Lasse Fredheim <lass@uio.no>
Date: Wed, 1 Mar 2023 14:35:11 +0100
Subject: [PATCH] Remove console output

---
 .../routes/sponsor/register/stepRegistration.tsx   | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/frontend/src/routes/sponsor/register/stepRegistration.tsx b/frontend/src/routes/sponsor/register/stepRegistration.tsx
index 4fe22457..1d3c72b0 100644
--- a/frontend/src/routes/sponsor/register/stepRegistration.tsx
+++ b/frontend/src/routes/sponsor/register/stepRegistration.tsx
@@ -95,9 +95,8 @@ export default function StepRegistration() {
           errorBodyText: errorText,
         })
       })
-      .catch((error) => {
+      .catch(() => {
         // Extracting data from body failed, just show an error message with no body text
-        console.error('error', error)
         setSubmitErrorReport({
           errorHeading: t('error.invitationCreationFailedHeader'),
           statusCode: res.status,
@@ -114,7 +113,6 @@ export default function StepRegistration() {
       .json()
       .then((jsonResponse) => {
         // If there is a body then it should have some json-content
-        console.log('result', jsonResponse)
 
         if ('code' in jsonResponse) {
           // There is something in the body indicating a warning
@@ -124,14 +122,8 @@ export default function StepRegistration() {
             statusText: undefined,
             errorBodyText: t(`error.codes.${jsonResponse.code}`),
           })
-        } else {
-          console.log(JSON.stringify(jsonResponse))
         }
       })
-      .catch((exception) => {
-        // There was a problem when extracting the body
-        console.error(exception)
-      })
       .finally(() => {
         setSubmitState(SubmitState.SubmitSuccess)
         setActiveStep(Steps.SuccessStep)
@@ -159,7 +151,6 @@ export default function StepRegistration() {
       },
     }
 
-    console.log('submitting', JSON.stringify(payload))
     fetch('/api/ui/v1/invite/', submitJsonOpts('POST', payload))
       .then((res) => {
         if (!res.ok) {
@@ -169,8 +160,7 @@ export default function StepRegistration() {
         }
         return null
       })
-      .catch((error) => {
-        console.error('error', error)
+      .catch(() => {
         setSubmitState(SubmitState.SubmitFailure)
       })
   }
-- 
GitLab