Extract $requestId from getRequest() return.

of course, getRequest() returns  a hash so we must properly extract the
value we want.

This fix causes this test to now pass:

ok 73 - fulfillRequest: databse entry from successful return is correct
This commit is contained in:
Bradley M. Kuhn 2015-12-20 17:02:44 -08:00
parent 6307cfdd26
commit f29a243db3

View file

@ -706,7 +706,9 @@ sub fulfillRequest($$) {
die "fulfillRequest: undefined who" unless defined $params->{who}; die "fulfillRequest: undefined who" unless defined $params->{who};
die "fulfillRequest: undefined requestType" unless defined $params->{requestType}; die "fulfillRequest: undefined requestType" unless defined $params->{requestType};
my $requestId = $self->getRequest($supporterId, $params->{requestType}); my $req = $self->getRequest($supporterId, $params->{requestType});
return undef if not defined $req;
my $requestId = $req->{requestId};
return undef if not defined $requestId; return undef if not defined $requestId;
my $fulfillLookupSql = "SELECT id, request_id FROM fulfillment WHERE request_id = " . my $fulfillLookupSql = "SELECT id, request_id FROM fulfillment WHERE request_id = " .