Updated code

This commit is contained in:
rajesh
2024-09-23 18:33:45 +05:30
parent 6f2bb714e1
commit afbdd70f6b
3 changed files with 7 additions and 4 deletions

View File

@@ -243,11 +243,11 @@ public class FlowFormDao {
.map(FlowEdgesEntity::getSourceId)
.toList();
List<FormEntity> previousForms = formRepository.findByIdIn(previousFormIds);
List<ApplicationFormEntity> applicationFormEntities=applicationFormRepository.findByFormIdInAndApplicationId(previousFormIds,applicationEntity.getId());
previousForms.sort(Comparator.comparing(FormEntity::getCreatedDate).reversed());
applicationFormEntities.sort(Comparator.comparing(ApplicationFormEntity::getCreatedDate).reversed());
return previousForms.isEmpty() ? null : previousForms.get(0).getId();
return applicationFormEntities.isEmpty() ? null : applicationFormEntities.get(0).getForm().getId();
}
public NextOrPreviousFormResponse getnextOrPreviousForm(ApplicationEntity applicationEntity, Long formId,
FormActionEnum action) {