Regler problème sur vote majoritaire

This commit is contained in:
Arimihanta 2021-07-14 07:16:40 +03:00
parent dce5e7d132
commit cf439ba51c

View file

@ -63,6 +63,31 @@ public class VMThemeRESTFacade extends AbstractRESTFacade<VMTheme>{
themes.forEach(theme -> {
this.orderChoices(theme);
newThemes.add(theme) ;
});
return newThemes ;
}
@DELETE
@Path("delete/{id}")
@RolesAllowed({"ADMIN"})
public void delete(@PathParam("id") Long id) {
themeService.delete(id);
}
@Override
//@RolesAllowed({"MODO"})
@PermitAll
public VMTheme find(Long id) {
boolean withChoices = this.overview == null;
VMTheme theme = themeService.find(id,withChoices,true);
this.orderChoices(theme);
return theme;
}
private void orderChoices(VMTheme theme){
Object []choices=theme.getChoices().toArray() ;
List<VMChoice> choicesNotVoted=new ArrayList<>() ;
List<ProposalTallyInterface> proposalTallyInterfaces=new ArrayList<>() ;
@ -111,26 +136,5 @@ public class VMThemeRESTFacade extends AbstractRESTFacade<VMTheme>{
}
theme.setChoices(setChoices);
newThemes.add(theme) ;
});
return newThemes ;
}
@DELETE
@Path("delete/{id}")
@RolesAllowed({"ADMIN"})
public void delete(@PathParam("id") Long id) {
themeService.delete(id);
}
@Override
//@RolesAllowed({"MODO"})
@PermitAll
public VMTheme find(Long id) {
boolean withChoices = this.overview == null;
VMTheme theme = themeService.find(id,withChoices,true);
return theme;
}
}