mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 00:02:15 +01:00
Renamed skip to offset
This commit is contained in:
committed by
Gregor Vostrak
parent
d200de54a8
commit
fcba96fbf6
@@ -85,7 +85,7 @@ class TimeEntryController extends Controller
|
||||
$limit = 1000;
|
||||
}
|
||||
$timeEntriesQuery->limit($limit);
|
||||
$timeEntriesQuery->skip($request->getSkip());
|
||||
$timeEntriesQuery->skip($request->getOffset());
|
||||
|
||||
$timeEntries = $timeEntriesQuery->get();
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ class TimeEntryIndexRequest extends FormRequest
|
||||
'max:500',
|
||||
],
|
||||
// Skip the first n time entries (default: 0)
|
||||
'skip' => [
|
||||
'offset' => [
|
||||
'integer',
|
||||
'min:0',
|
||||
],
|
||||
@@ -154,8 +154,8 @@ class TimeEntryIndexRequest extends FormRequest
|
||||
return $this->has('limit') ? (int) $this->validated('limit', 100) : 100;
|
||||
}
|
||||
|
||||
public function getSkip(): int
|
||||
public function getOffset(): int
|
||||
{
|
||||
return $this->has('skip') ? (int) $this->validated('skip', 0) : 0;
|
||||
return $this->has('offset') ? (int) $this->validated('offset', 0) : 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -468,7 +468,7 @@ class TimeEntryEndpointTest extends ApiEndpointTestAbstract
|
||||
);
|
||||
}
|
||||
|
||||
public function test_index_endpoint_with_limit_skip_and_only_full_dates_deactivated(): void
|
||||
public function test_index_endpoint_with_limit_offset_and_only_full_dates_deactivated(): void
|
||||
{
|
||||
// Arrange
|
||||
$data = $this->createUserWithPermission([
|
||||
@@ -494,7 +494,7 @@ class TimeEntryEndpointTest extends ApiEndpointTestAbstract
|
||||
'member_id' => $data->member->getKey(),
|
||||
'project_ids' => [$project1->getKey()],
|
||||
'limit' => 1,
|
||||
'skip' => 1,
|
||||
'offset' => 1,
|
||||
'only_full_dates' => 'false',
|
||||
]));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user