Merge pull request #53 from HediMjid/sana

modif pour que le find membre by team ne récupère pas les membres sof…
This commit is contained in:
Blandine Bajard 2022-03-07 15:04:56 +01:00 committed by GitHub
commit 4282b09307
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View File

@ -101,9 +101,9 @@ public class MembreController {
}
/**
* Rechercher un membre par l'Id de sa team
* Rechercher les membres par l'Id de leur team
*
* @return http://localhost:8088/membres/1
* @return http://localhost:8088/membres/team/1
*/
@GetMapping(value = "team/{team_id}")
//@PreAuthorize("hasRole('ROLE_PARENT') or hasRole('ROLE_ENFANT')")

View File

@ -1,8 +1,6 @@
package fr.organizee.repository;
import fr.organizee.model.Contact;
import fr.organizee.model.Membre;
import fr.organizee.model.Menu;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
@ -14,7 +12,7 @@ import java.util.Optional;
@Repository
public interface MembreRepository extends JpaRepository<Membre, Integer> {
@Query(value = "select * from membre where team_id = :team_id", nativeQuery = true)
@Query(value = "select * from membre where deleted = false AND team_id = :team_id", nativeQuery = true)
List<Membre> FindMembresByTeam(@Param("team_id") int team_id);
Membre findByNom(String nom);