[R4] Only find the active doctors
This commit is contained in:
parent
34071ec1d8
commit
bbde76cedc
@ -27,10 +27,10 @@ public class FindDoctorsUseCase {
|
||||
*
|
||||
* @param pageable Pagination information, such as size and page number
|
||||
*
|
||||
* @return A paginated list with stored doctors if successful, or null if there is an error
|
||||
* @return A paginated list with active stored doctors if successful, or null if there is an error
|
||||
*
|
||||
*/
|
||||
public Page<Doctor> execute(Pageable pageable) {
|
||||
return this.doctorRepository.findAll(pageable);
|
||||
return this.doctorRepository.findDoctorsByActiveTrue(pageable);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.mirna.hospitalmanagementapi.domain.repositories;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import com.mirna.hospitalmanagementapi.domain.entities.Doctor;
|
||||
@ -12,4 +14,5 @@ import com.mirna.hospitalmanagementapi.domain.entities.Doctor;
|
||||
*/
|
||||
public interface DoctorRepository extends JpaRepository<Doctor, Long> {
|
||||
|
||||
Page<Doctor> findDoctorsByActiveTrue(Pageable pageable);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user