Gets FromJsonPath working for EntityController to have GetByIds with all types of Ids for both GET and POST

This commit is contained in:
Shannon
2017-01-31 19:11:05 +11:00
parent 8d598cd37c
commit e95cb14d48
5 changed files with 108 additions and 41 deletions

View File

@@ -166,24 +166,17 @@ function entityResource($q, $http, umbRequestHelper) {
*/
getByIds: function (ids, type) {
var query = "";
_.each(ids, function(item) {
query += "ids=" + item + "&";
});
// if ids array is empty we need a empty variable in the querystring otherwise the service returns a error
if (ids.length === 0) {
query += "ids=&";
}
query += "type=" + type;
var query = "type=" + type;
return umbRequestHelper.resourcePromise(
$http.get(
$http.post(
umbRequestHelper.getApiUrl(
"entityApiBaseUrl",
"GetByIds",
query)),
query),
{
ids: ids
}),
'Failed to retrieve entity data for ids ' + ids);
},