Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
zouabimourad committed Jul 11, 2020
1 parent 137af85 commit ed69014
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@
import net.mzouabi.ng2.server.service.PersonService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;


@RequiredArgsConstructor
@RestController
Expand All @@ -22,13 +18,9 @@ public class PersonController {
private final PersonService personService;

@GetMapping()
public ResponseEntity<Page<PersonDTO>> findAllPerson(Pageable pageable , HttpServletResponse httpServletResponse) {
public ResponseEntity<Page<PersonDTO>> findAllPerson(Pageable pageable) {

Page<PersonDTO> page = personService.findPersons(pageable);

httpServletResponse.addCookie(new Cookie("mycookie","hello"));
httpServletResponse.addHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, "true");

return new ResponseEntity<>(page, HttpStatus.OK);
}

Expand Down

0 comments on commit ed69014

Please sign in to comment.