Closed stevehogdahl closed 3 years ago
Can you give an example of how this is broken? Some sort of error, or show the expected & actual results?
(Object.keys(p).length === 2 && p.name && p.value !== 'undefined')
returns true for the following query and parameters. As you can see there is no value
parameter, but it still returns true p.value !== 'undefined'
. The error is that :name
doesn't get parameterized.
dataApi.query( 'SELECT name FROM asset WHERE name = :name AND tenant_id = :tenantId,
{
name: body.name,
tenantId: parseInt( validate.pathParameters.tenantId )
} );
Fixed, and confirmed working. Thanks! @jeremydaly will have to publish to npm, I don't have permissions to do so.
Thanks for the responses/fix!
The following use case is broken because the p.value check in noramlizeParams is broken.
The p.value undefined should be either
p.value !== undefined
ortypeof p.value !== 'undefined'
.