Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error when loading monitoried tags page(#1478) #1485

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/js/screens/monitoring/tag-jobs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

tag = this.type == 'failed' ? 'failed:' + tag : tag;

this.$http.get(Horizon.basePath + '/api/monitoring/' + encodeURIComponent(tag) + '?starting_at=' + starting + '&limit=' + this.perPage)
this.$http.get(Horizon.basePath + '/api/monitoring/' + encodeURIComponent(tag) + '?starting_at=' + starting + '&limit=' + this.perPage + '&tag=' + encodeURIComponent(tag))
.then(response => {
if (!this.$root.autoLoadsNewEntries && refreshing && this.jobs.length && response.data.jobs[0]?.id !== this.jobs[0]?.id) {
this.hasNewEntries = true;
Expand Down
5 changes: 3 additions & 2 deletions src/Http/Controllers/MonitoringController.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ public function index()
* Paginate the jobs for a given tag.
*
* @param \Illuminate\Http\Request $request
* @param string $tag
* @return array
*/
public function paginate(Request $request, $tag)
public function paginate(Request $request)
{
$tag = $request->query('tag');

$jobIds = $this->tags->paginate(
$tag, $startingAt = $request->query('starting_at', 0),
$request->query('limit', 25)
Expand Down
4 changes: 2 additions & 2 deletions tests/Controller/MonitoringControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function test_monitored_jobs_can_be_paginated_by_tag()

// Paginate first set...
$response = $this->actingAs(new Fakes\User)
->get('/horizon/api/monitoring/tag');
->get('/horizon/api/monitoring/tag?tag=tag');

$results = $response->original['jobs'];

Expand All @@ -57,7 +57,7 @@ public function test_monitored_jobs_can_be_paginated_by_tag()

// Paginate second set...
$response = $this->actingAs(new Fakes\User)
->get('/horizon/api/monitoring/tag?starting_at=25');
->get('/horizon/api/monitoring/tag?starting_at=25&tag=tag');

$results = $response->original['jobs'];

Expand Down