Opened 8 years ago
Last modified 4 years ago
#16322 new enhancement
dojo/store/JsonRest add function does PUT with null in url
Reported by: | HaraldOnline | Owned by: | Kris Zyp |
---|---|---|---|
Priority: | undecided | Milestone: | 1.15 |
Component: | Data | Version: | 1.8.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
I'm trying to make my JS client-side code a little bit more robust (and better documented) by using dojo classes for my models.
When I include the id-column in the model as a property initialized with null and call the Json Rest store add function a HTTP PUT (=update) is performed with a null parameter for the id in the url. At least when calling add I would expect that an HTTP POST is performed every time.
This is especially true because all null-valued properties aren't sent to the server (neither on PUT nor POST) ...
While writing this I had the idea to use the value undefined for the id and it worked like it should (yes, I've been mostly coding in C# for the last years ;)
Nevertheless was the behavior unexpected and should be documented if not changed.
Change History (3)
comment:1 Changed 8 years ago by
comment:2 Changed 5 years ago by
Milestone: | tbd → 1.12 |
---|
comment:3 Changed 4 years ago by
Milestone: | 1.13 → 1.15 |
---|
Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.
PS: While calling the JsonRest? store put method like
the store nevertheless tried a POST against my server (because it couldn't find the id). Why is the option overwrite not honored?
From http://dojotoolkit.org/reference-guide/1.8/dojo/store/JsonRest.html#id3
"A value of true [for overwrite] indicates that a new object should not be created"