forked from lix-project/hydra
Serialize data as JSON with Accept: application/json
Similar to #607. According to the Catalyst[1] docs it's possible to specify a data structure that is supposed to be serialized when requesting i.e. a JSON response. [1] https://metacpan.org/pod/Catalyst::Controller::REST#status_ok
This commit is contained in:
parent
b298ba4bbe
commit
1cbbc6c52c
1 changed files with 4 additions and 1 deletions
|
@ -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});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -344,7 +345,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});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue