Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
Doorcode
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Guardians of the Kretschmar Elock System
Doorcode
Commits
1b802653
Commit
1b802653
authored
Jul 22, 2020
by
Jacob Priddy
👌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add pagination to a route that was missing it
parent
bf0acfd5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
src/backend/app/Http/Controllers/Api/GroupScheduleController.php
...kend/app/Http/Controllers/Api/GroupScheduleController.php
+1
-0
src/backend/src/UseCases/GroupSchedule/GetGroupSchedules/ApiPresenter.php
...UseCases/GroupSchedule/GetGroupSchedules/ApiPresenter.php
+6
-3
No files found.
src/backend/app/Http/Controllers/Api/GroupScheduleController.php
View file @
1b802653
...
...
@@ -90,6 +90,7 @@ class GroupScheduleController extends ApiController
* This endpoint returns all schedules that a specified group is attached to.
*
* @authenticated
* @paginated
* @urlParam groupId required The id of the group to get the schedules for. Example: 7
*
* @param string $groupId
...
...
src/backend/src/UseCases/GroupSchedule/GetGroupSchedules/ApiPresenter.php
View file @
1b802653
...
...
@@ -3,21 +3,24 @@
namespace
Source\UseCases\GroupSchedule\GetGroupSchedules
;
use
Source\Entities\Schedule
;
use
Source\Sanitize\Paginates
;
use
Source\UseCases\BasePresenter
;
class
ApiPresenter
extends
BasePresenter
implements
Presenter
{
protected
array
$viewModel
=
[];
use
Paginates
;
protected
array
$schedules
=
[];
/** @inheritDoc */
public
function
present
(
ResponseModel
$responseModel
):
void
{
$this
->
viewModel
[
'schedules'
]
=
array_map
(
fn
(
Schedule
$schedule
):
array
=>
self
::
formatSchedule
(
$schedule
),
$responseModel
->
getSchedules
());
$this
->
schedules
=
array_map
(
fn
(
Schedule
$schedule
):
array
=>
self
::
formatSchedule
(
$schedule
),
$responseModel
->
getSchedules
());
}
/** @inheritDoc */
public
function
getViewModel
():
array
{
return
$this
->
viewModel
;
return
$this
->
paginate
(
$this
->
schedules
)
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment