Skip to content

Commit

Permalink
Fix error when loading monitoried tags page(#1478) (#1485)
Browse files Browse the repository at this point in the history
  • Loading branch information
therobfonz authored Aug 5, 2024
1 parent b025ae3 commit 184449b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
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

0 comments on commit 184449b

Please sign in to comment.