Skip to content

Commit

Permalink
fix gifts pagination (#984)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrilyew authored Sep 18, 2023
1 parent 43de40a commit cc5a569
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Web/Models/Repositories/Gifts.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,10 @@ function getCategories(int $page, ?int $perPage = NULL, &$count = nullptr): \Tra
foreach($cats as $cat)
yield new GiftCategory($cat);
}

function getCategoriesCount(): int
{
$cats = $this->cats->where("deleted", false);
return $cats->count();
}
}
1 change: 1 addition & 0 deletions Web/Presenters/GiftsPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ function renderGiftMenu(): void

$this->template->user = $user;
$this->template->iterator = $cats;
$this->template->count = $this->gifts->getCategoriesCount();
$this->template->_template = "Gifts/Menu.xml";
}

Expand Down

0 comments on commit cc5a569

Please sign in to comment.