Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft: Càrrega inicial des de les sincronitzacions existents #26

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,21 @@ public List<SiteSynchronization> getLinkedSiteSynchronizations(boolean fillSite)

@Override
public List<SiteSynchronization> getFilteredSiteSynchronizations(boolean fillSite, SakaiSiteFilter filter, ZonedDateTime fromDate, ZonedDateTime toDate) {
List<SiteSynchronization> result = microsoftSiteSynchronizationRepository.findByDate(fromDate, toDate);

if(filter.getSiteProperty().isEmpty()){
return result.stream().map(ss -> {
if (fillSite) {
ss.setSite(sakaiProxy.getSite(ss.getSiteId()));
}
return ss;
})
.collect(Collectors.toList());
}

final List<Site> sites = sakaiProxy.getSakaiSites(filter);

List<SiteSynchronization> result = microsoftSiteSynchronizationRepository.findByDate(fromDate, toDate).stream().map(ss -> {
return result.stream().map(ss -> {
Site site = null;
if (fillSite) {
site = sites.stream().filter(s -> s.getId().equals(ss.getSiteId())).findFirst().orElse(null);
Expand All @@ -237,7 +249,6 @@ public List<SiteSynchronization> getFilteredSiteSynchronizations(boolean fillSit
})
.filter(Objects::nonNull)
.collect(Collectors.toList());
return result;
}

@Override
Expand Down
Loading