Skip to content

Commit

Permalink
fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
SundarakrishnanN committed Jun 11, 2024
1 parent 8409f06 commit aeab28e
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ public ResponseRequestFormDTO postRequestForm(@RequestParam("eventTitle") String
@RequestParam("isFinance") boolean isFinance, @RequestParam("formPDF") MultipartFile formPDF)
throws InvalidDataException, PDFNotConversionException {
LOGGER.info("in: post request form");
RequestForm savedRequestForm;
RequestForm requestForm = new RequestForm();
requestForm.setEventTitle(eventTitle);
requestForm.setFinance(isFinance);
Expand All @@ -150,20 +151,18 @@ public ResponseRequestFormDTO postRequestForm(@RequestParam("eventTitle") String

requestForm.setRequestHierarchy(roleService.generateHierarchy(optionalUser, isFinance));

requestForm.setFormPDF(formPDF.getBytes());



userService.setPendingRequests(requestForm, requestForm.getRequestHierarchy(),
requestForm.getRequestIndex(), optionalUser);

} catch (Exception e) {
LOGGER.warn("Exception getting user and hierarchy", e);
}

try {
requestForm.setFormPDF(formPDF.getBytes());
} catch (java.io.IOException e) {
throw new PDFNotConversionException("Could not store pdf");
}

RequestForm savedRequestForm = requestFormService.save(requestForm);
return modelMapper.map(savedRequestForm, ResponseRequestFormDTO.class);// truncated
savedRequestForm = requestFormService.save(requestForm);
return modelMapper.map(savedRequestForm, ResponseRequestFormDTO.class);
}

@PutMapping("/{requestFormId}")
Expand Down

0 comments on commit aeab28e

Please sign in to comment.