Added an optional parameter onlyPreferredCall in the getAllCalls API to filter the response and include only preferred calls
This commit is contained in:
@@ -100,8 +100,8 @@ public interface CallApi {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
||||
@GetMapping(value = "",
|
||||
produces = { "application/json" })
|
||||
ResponseEntity<Response<List<CallDetailsResponseBean>>> getAllCalls(HttpServletRequest request,@RequestParam(value = "companyId", required = false) Long companyId);
|
||||
|
||||
ResponseEntity<Response<List<CallDetailsResponseBean>>> getAllCalls(HttpServletRequest request,@RequestParam(value = "companyId", required = false) Long companyId , @RequestParam(value = "onlyPreferredCall", required = false, defaultValue = "false") Boolean onlyPreferredCall);
|
||||
|
||||
|
||||
@Operation(summary = "Api to validate call",
|
||||
responses = {
|
||||
|
||||
@@ -67,8 +67,8 @@ public class CallApiController implements CallApi {
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public ResponseEntity<Response<List<CallDetailsResponseBean>>> getAllCalls(HttpServletRequest request,Long companyId) {
|
||||
List<CallDetailsResponseBean> calls = callService.getAllCalls(request,companyId);
|
||||
public ResponseEntity<Response<List<CallDetailsResponseBean>>> getAllCalls(HttpServletRequest request,Long companyId,Boolean onlyPreferredCall) {
|
||||
List<CallDetailsResponseBean> calls = callService.getAllCalls(request,companyId,onlyPreferredCall);
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK)
|
||||
.body(new Response<>(calls, Status.SUCCESS, Translator.toLocale(GepafinConstant.CALL_FETCH_SUCCESS_MSG)));
|
||||
|
||||
Reference in New Issue
Block a user