Opened 11 years ago

Closed 11 years ago

Last modified 9 years ago

#7098 closed defect (fixed)

JsonRestStore fetchItemByIdentity

Reported by: guest Owned by: Kris Zyp
Priority: high Milestone: 1.2
Component: DojoX Data Version: 1.1.1
Keywords: JsonRestStore, fetchItemByIdentity Cc: maulinpshah@…
Blocked By: Blocking:

Description

Kris,

fyi: There is no unit test for fetchItemByIdentity in your JsonRestStore? unit tests ("fetch by id" uses "fetch", not "fetchItemByIdentity")

I think the following is problematic:

args.onComplete = args.onItem;

because this means that the onItem I pass in would get called twice (once for onItem, once for onComplete). If you are trying to make sure that there is no onComplete, then you can make this assignment, but then should delete args.onItem so that the callback is only called once.

So I would say that you should do:

args.onComplete = args.onItem; args.onItem = null; or delete argsonItem?

This would also fix the case where my get() method (or the REST get method) returned a simple JSON object instead of an array of objects when returning only one object from a query. (i.e. it handles both:

[{id:xx, ...}] and {id:xx, ...}

as valid return values for a fetchItemByIdentity

Change History (3)

comment:1 Changed 11 years ago by Jared Jurkiewicz

Owner: changed from Jared Jurkiewicz to kriszyp

comment:2 Changed 11 years ago by Kris Zyp

Resolution: fixed
Status: newclosed

(In [14237]) Better separatation of concerns in architecture Refers #6981 and fixes #7103 and #7098

comment:3 Changed 9 years ago by bill

Owner: changed from kriszyp to Kris Zyp
Note: See TracTickets for help on using tickets.