Skip to content

Commit d5ba44b

Browse files
committed
refactor(job-application): fix null issue in job-application creation notification
1 parent ad1856d commit d5ba44b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

apps/jobboard-backend/src/main/java/org/bounswe/jobboardbackend/jobapplication/service/JobApplicationService.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,12 @@ public JobApplicationResponse create(CreateJobApplicationRequest dto) {
142142
.appliedDate(LocalDateTime.now())
143143
.build();
144144

145-
notificationService.notifyUser(jobPost.getEmployer().getUsername(), "New Job Application Request", NotificationType.JOB_APPLICATION_REQUEST, "New Job Application Request from " + jobSeeker.getUsername(), application.getId());
146145

147-
return toResponseDto(applicationRepository.save(application));
146+
JobApplication savedApplication = applicationRepository.save(application);
147+
148+
notificationService.notifyUser(jobPost.getEmployer().getUsername(), "New Job Application Request", NotificationType.JOB_APPLICATION_REQUEST, "New Job Application Request from " + jobSeeker.getUsername(), savedApplication.getId());
149+
150+
return toResponseDto(savedApplication);
148151
}
149152

150153
@Transactional

0 commit comments

Comments
 (0)