Fix API call
This commit is contained in:
parent
44722fdd93
commit
7f418a06fe
3 changed files with 11 additions and 4 deletions
|
|
@ -105,8 +105,10 @@ sub send($$$)
|
|||
log(DEBUG, 'POST Request to ', API_URL, $url);
|
||||
my $req = POST API_URL . $url, shift;
|
||||
|
||||
my $cnt = $ua->request($req)->content;
|
||||
my $res = $ua->request($req);
|
||||
log TRACE, $res;
|
||||
|
||||
my $cnt = $res->content();
|
||||
log TRACE, $cnt;
|
||||
|
||||
return parse($next, $cnt);
|
||||
|
|
|
|||
|
|
@ -103,7 +103,10 @@ sub add_grades($;$)
|
|||
my %data = (
|
||||
project_name => shift
|
||||
);
|
||||
$data{year} = $_ if (shift);
|
||||
my $y = shift;
|
||||
if ($y) {
|
||||
$data{year} = $y;
|
||||
}
|
||||
|
||||
my $res = API::Base::send('ResultHandler', "projects/notes/add.xml", \%data);
|
||||
|
||||
|
|
@ -120,7 +123,10 @@ sub add_traces($$;$)
|
|||
project_name => shift,
|
||||
trace_name => shift,
|
||||
);
|
||||
$data{year} = $_ if (shift);
|
||||
my $y = shift;
|
||||
if ($y) {
|
||||
$data{year} = $y;
|
||||
}
|
||||
|
||||
my $res = API::Base::send('ResultHandler', "projects/traces/add.xml", \%data);
|
||||
|
||||
|
|
|
|||
|
|
@ -178,7 +178,6 @@ sub genIds ($;$)
|
|||
}
|
||||
else {
|
||||
$ans_i += 1;
|
||||
$cur_aid = $answer->{id};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue