From 955ca75035aaa223fc8bc07416ca4c31e7a9d1c2 Mon Sep 17 00:00:00 2001
From: Sophie Zhang <sophie_zhang@brown.edu>
Date: Thu, 27 Jul 2023 13:39:22 -0400
Subject: removed new endpoint for now

---
 src/client/util/reportManager/ReportManager.tsx | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

(limited to 'src/client/util/reportManager/ReportManager.tsx')

diff --git a/src/client/util/reportManager/ReportManager.tsx b/src/client/util/reportManager/ReportManager.tsx
index f20c2baaa..e684bd637 100644
--- a/src/client/util/reportManager/ReportManager.tsx
+++ b/src/client/util/reportManager/ReportManager.tsx
@@ -124,15 +124,13 @@ export class ReportManager extends React.Component<{}> {
             alert('Please fill out all required fields to report an issue.');
             return;
         }
-        let formattedLinks: string[] = [];
         this.setSubmitting(true);
+        let formattedLinks: string[] = [];
         if (this.formData.mediaFiles.length > 0) {
             const links = await uploadFilesToServer(this.formData.mediaFiles);
-            console.log(links);
-            if (!links) {
-                return;
+            if (links) {
+                formattedLinks = links;
             }
-            formattedLinks = links;
         }
 
         const req = await this.octokit.request('POST /repos/{owner}/{repo}/issues', {
@@ -146,14 +144,12 @@ export class ReportManager extends React.Component<{}> {
         // 201 status means success
         if (req.status !== 201) {
             alert('Error creating issue on github.');
-            return;
+        } else {
+            await this.updateIssues();
+            alert('Successfully submitted issue.');
         }
-
-        // Reset fields
         this.setFormData(emptyReportForm);
         this.setSubmitting(false);
-        await this.updateIssues();
-        alert('Successfully submitted issue.');
     }
 
     /**
-- 
cgit v1.2.3-70-g09d2

