Skip to content

Commit

Permalink
fix: logical error in the success response (#1894)
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-elimu committed Sep 30, 2024
1 parent 7145e7e commit 7975194
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,17 @@ public String handleUploadCsvRequest(
File csvFile = new File(videoLearningEventsDir, originalFilename);
logger.info("Storing CSV file at " + csvFile);
multipartFile.transferTo(csvFile);

jsonResponseObject.put("result", "success");
jsonResponseObject.put("successMessage", "The CSV file was uploaded");
response.setStatus(HttpStatus.OK.value());
} catch (Exception ex) {
logger.error(ex);

jsonResponseObject.put("result", "error");
jsonResponseObject.put("errorMessage", ex.getMessage());
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
}
jsonResponseObject.put("result", "success");
jsonResponseObject.put("successMessage", "The CSV file was uploaded");
response.setStatus(HttpStatus.OK.value());

String jsonResponse = jsonResponseObject.toString();
logger.info("jsonResponse: " + jsonResponse);
Expand Down

0 comments on commit 7975194

Please sign in to comment.