Quantcast
Channel: DreamFactory Forum - Latest posts
Viewing all articles
Browse latest Browse all 5028

Related param is ignored when trying to access api through event script

$
0
0

Hello all,

I’m trying to access api with related params through POST pre-process script,
but the related param is ignored, no related object is returned.

this is my request

var filter_params = {"related":[{"name":"voucher_redemption_by_voucher_id"}]};                   

var voucher = platform.api.get( "blu/_table/voucher", filter_params);
throw JSON.stringify(voucher);

i tried to set * to related to get all, but still none related object is returned.

to found a way around this, i added GET pre-process script to table voucher that should append a related param like below

event.request.payload.resource[0].related = [{"name":"voucher_redemption_by_voucher_id"}];

but this error is returned
> Cannot read property '0' of undefined

currently using:
Admin Application Version: 2.0.6
DreamFactory Version: 2.0.4

am i doing it wrong?

Thank you

Yahya


Viewing all articles
Browse latest Browse all 5028