Skip to content

Commit

Permalink
RI-203: permet de valider une offre et les groupes
Browse files Browse the repository at this point in the history
  • Loading branch information
nekorpeche committed Dec 11, 2021
1 parent d940a29 commit 5a28484
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import com.dynonuggets.refonteimplicaction.repository.FileRepository;
import com.dynonuggets.refonteimplicaction.repository.GroupRepository;
import com.dynonuggets.refonteimplicaction.repository.UserRepository;
import com.dynonuggets.refonteimplicaction.repository.SubredditRepository;
import com.dynonuggets.refonteimplicaction.repository.UserRepository;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
Expand Down Expand Up @@ -92,13 +90,13 @@ public List<GroupDto> addGroup(String groupName) {

@Transactional
public Page<GroupDto> getAllPendingGroups(Pageable pageable) {
return subredditRepository.findAllByValidIsFalse(pageable)
.map(subredditAdapter::toDto);
return groupRepository.findAllByValidIsFalse(pageable)
.map(groupAdapter::toDto);
}

@Transactional
public void validateGroup(Group group) {
group.setValid(true);
subredditRepository.save(group);
groupRepository.save(group);
}
}

0 comments on commit 5a28484

Please sign in to comment.