Jobsets: update schema to align with the API

To further align with the API, we return custom JSON in order to display a
`visible` field rather than `hidden` -- a `PUT` request expects `visible`, while
a `GET` request returns `hidden`.

This also allows us to rename the `jobsetinputs` field to `inputs` for the same
reason: `PUT` expects `inputs`, while `GET` returns `jobsetinputs`.
This commit is contained in:
Cole Helbling
2021-04-28 12:41:05 -07:00
committed by Graham Christensen
parent d23f431889
commit f1dd5d202e
6 changed files with 58 additions and 60 deletions

View File

@ -270,8 +270,8 @@ sub updateJobset {
$jobset->jobsetinputs->delete;
if ($type == 0) {
foreach my $name (keys %{$c->stash->{params}->{jobsetinputs}}) {
my $inputData = $c->stash->{params}->{jobsetinputs}->{$name};
foreach my $name (keys %{$c->stash->{params}->{inputs}}) {
my $inputData = $c->stash->{params}->{inputs}->{$name};
my $type = $inputData->{type};
my $value = $inputData->{value};
my $emailresponsible = defined $inputData->{emailresponsible} ? 1 : 0;