Skip to content

Commit

Permalink
RI-174: Modifier les listing des offres pour n'afficher que les offre…
Browse files Browse the repository at this point in the history
…s non archivées
  • Loading branch information
nekorpeche committed Dec 2, 2021
1 parent 524ad4a commit 1d1d3ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.dynonuggets.refonteimplicaction.exception.ImplicactionException;
import com.dynonuggets.refonteimplicaction.service.JobPostingService;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
Expand Down Expand Up @@ -37,12 +38,12 @@ public ResponseEntity<Page<JobPostingDto>> getAllByCriteria(
@RequestParam(value = "search", defaultValue = "") String search,
@RequestParam(value = "contractType", required = false) String contractType,
@RequestParam(value = "checkApply", required = false) String checkApplyAsString,
@RequestParam(value = "archive", required = false) String archive
@RequestParam(value = "archiveAsString", required = false) String archiveAsString
) {
Pageable pageable = PageRequest.of(page, rows, Sort.by(Sort.Direction.valueOf(sortOrder), sortBy));
final boolean applyCheck = Boolean.parseBoolean(checkApplyAsString);
final boolean isArchive = Boolean.parseBoolean(archive);
Page<JobPostingDto> jobPostingDtos = jobPostingService.getAllWithCriteria(pageable, search, contractType, applyCheck, isArchive);
final Boolean isArchive = StringUtils.isNotBlank(archiveAsString) ? Boolean.parseBoolean(archiveAsString) : null;
Page<JobPostingDto> jobPostingDtos = jobPostingService.getAllWithCriteria(pageable, search, contractType, isArchive, applyCheck);
return ResponseEntity.ok(jobPostingDtos);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export class ApiEndpointsService {
* Jobs
*/

getAllJobEndpoint(pageable: Pageable, criteria: JobCriteriaFilter, archive: Boolean, checkApply: boolean): string {
getAllJobEndpoint(pageable: Pageable, criteria: JobCriteriaFilter, archive: boolean, checkApply: boolean): string {
// on merge les filtres et les attributs de pagination
const objectParam = {
...criteria,
Expand All @@ -215,7 +215,7 @@ export class ApiEndpointsService {
sortBy: pageable.sortBy,
sortOrder: pageable.sortOrder,
checkApply: checkApply,
archive: archive
archive: archive !== null ? `${archive}` : null
};
return ApiEndpointsService.createUrlWithQueryParameters(
Uris.JOBS.BASE_URI,
Expand Down

0 comments on commit 1d1d3ab

Please sign in to comment.