Skip to content

Commit

Permalink
refactor: remove return type option
Browse files Browse the repository at this point in the history
  • Loading branch information
glaubersilva committed Sep 4, 2024
1 parent 1da2e15 commit 5d1b45f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Campaigns/Routes/GetCampaignsListTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,9 @@ public function handleRequest(WP_REST_Request $request): WP_REST_Response
$campaignsCount = $this->getTotalCampaignsCount();
$pageCount = (int)ceil($campaignsCount / $request->get_param('perPage'));

if ('model' === $this->request->get_param('return')) {
$items = $campaigns;
} else {
$this->listTable->items($campaigns, $this->request->get_param('locale') ?? '');
$items = $this->listTable->getItems();
}
$this->listTable->items($campaigns, $this->request->get_param('locale') ?? '');
$items = $this->listTable->getItems();


return new WP_REST_Response(
[
Expand Down

0 comments on commit 5d1b45f

Please sign in to comment.