mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 08:12:17 +01:00
Add skip and meta to resource in time entry endpoint
This commit is contained in:
committed by
Gregor Vostrak
parent
3ee7839ca9
commit
a882ec6ca0
@@ -131,6 +131,11 @@ class TimeEntryIndexRequest extends FormRequest
|
||||
'min:1',
|
||||
'max:500',
|
||||
],
|
||||
// Skip the first n time entries (default: 0)
|
||||
'skip' => [
|
||||
'integer',
|
||||
'min:0',
|
||||
],
|
||||
// Filter makes sure that only time entries of a whole date are returned
|
||||
'only_full_dates' => [
|
||||
'string',
|
||||
@@ -143,4 +148,14 @@ class TimeEntryIndexRequest extends FormRequest
|
||||
{
|
||||
return $this->input('only_full_dates', 'false') === 'true';
|
||||
}
|
||||
|
||||
public function getLimit(): int
|
||||
{
|
||||
return $this->has('limit') ? (int) $this->validated('limit', 100) : 100;
|
||||
}
|
||||
|
||||
public function getSkip(): int
|
||||
{
|
||||
return $this->has('skip') ? (int) $this->validated('skip', 0) : 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user