EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

put request (update service) onSuccess get data from same updated record

Hi There, I m very bad to find a 'great title' (at least it's descriptive).

I am updating a field of a given record with a PUT request using service mapping.
all that works fine.

however, I thought that onSuccess of that above PUT request, I could GET data from the same record but other fields via mapping.

the console throws me an error msg as follows :
Uncaught Error: Attempt to access Object by index: 0
sources describes:
if (_.isTrueObject(data) && arrayLevel) throw new Error("Attempt to access Object by index: " + pathHead);

i structured the mapping as a usual GET request with
body / $ as array / $ as object / fieldName as string
shall hv I done it different ?

any idea ?
best,
Eric

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

put request (update service) onSuccess get data from same updated record

Eric,
Not sure if this is your issue or not ... But if your service returns only one row ... Then you can access the field by data.fieldname ... Instead of data.fieldname.
Best,
Bruce

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

put request (update service) onSuccess get data from same updated record

Hi Bruce, thks for your advice.
it can be something like this.
I'll check this out.
hv a good day!
Eric

Return to “Issues”