Merge pull request #636 from Ma27/serve-json-for-evals-and-machines

Serialize data as JSON with `Accept: application/json`
This commit is contained in:
Graham Christensen 2019-03-17 17:17:17 -04:00 committed by GitHub
commit 88a92256e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -197,6 +197,7 @@ sub machines :Local Args(0) {
"where busy != 0 order by machine, stepnr", "where busy != 0 order by machine, stepnr",
{ Slice => {} }); { Slice => {} });
$c->stash->{template} = 'machine-status.tt'; $c->stash->{template} = 'machine-status.tt';
$self->status_ok($c, entity => $c->stash->{machines});
} }
@ -350,7 +351,9 @@ sub evals :Local Args(0) {
$c->stash->{page} = $page; $c->stash->{page} = $page;
$c->stash->{resultsPerPage} = $resultsPerPage; $c->stash->{resultsPerPage} = $resultsPerPage;
$c->stash->{total} = $evals->search({hasnewbuilds => 1})->count; $c->stash->{total} = $evals->search({hasnewbuilds => 1})->count;
$c->stash->{evals} = getEvals($self, $c, $evals, ($page - 1) * $resultsPerPage, $resultsPerPage) $c->stash->{evals} = getEvals($self, $c, $evals, ($page - 1) * $resultsPerPage, $resultsPerPage);
$self->status_ok($c, entity => $c->stash->{evals});
} }