diff --git a/src/app/entity/controllers/ListInstanceController.php b/src/app/entity/controllers/ListInstanceController.php index e0ba2726d2164549815be54b8358f4a4bd557334..0ab30cbe222a519e6dd36e56ad996a199c758e23 100755 --- a/src/app/entity/controllers/ListInstanceController.php +++ b/src/app/entity/controllers/ListInstanceController.php @@ -101,20 +101,20 @@ class ListInstanceController $listinstances[] = ['resId' => $res_id, "listinstances" => $array]; } - return $response->withJson(['listinstances' => $listinstances]); + return $response->withJson($listinstances); } public function update(Request $request, Response $response) { $data = $request->getParams(); - if (empty($data['listinstances'])) { + if (empty($data)) { return $response->withStatus(400)->withJson(['errors' => 'listinstances is missing or is empty']); } DatabaseModel::beginTransaction(); - foreach ($data['listinstances'] as $ListInstanceByRes) { + foreach ($data as $ListInstanceByRes) { if (empty($ListInstanceByRes['resId'])) { DatabaseModel::rollbackTransaction(); return $response->withStatus(400)->withJson(['errors' => 'resId is empty']); diff --git a/src/frontend/app/administration/user/users-administration.component.ts b/src/frontend/app/administration/user/users-administration.component.ts index 4d10dbc09313d8ee4a1f1fe90fb932baa4f24037..c55261e1db0ca0c7c566b6ebf229aee068ed8501 100755 --- a/src/frontend/app/administration/user/users-administration.component.ts +++ b/src/frontend/app/administration/user/users-administration.component.ts @@ -230,7 +230,7 @@ export class UsersAdministrationComponent extends AutoCompletePlugin implements //update listInstances this.updateListInstance = false; - this.http.put(this.coreUrl + 'rest/listinstances', user) + this.http.put(this.coreUrl + 'rest/listinstances', user.listinstances) .subscribe((data: any) => { if (data.errors) { this.notify.error(data.errors); @@ -273,7 +273,6 @@ export class UsersAdministrationComponent extends AutoCompletePlugin implements //user inDiffListDest } else if (user.inDiffListDest && !user.isResDestUser) { - //update listModels this.updateListModel = false; this.http.put(this.coreUrl + 'rest/listTemplates/entityDest/itemId/' + user.user_id, user) @@ -314,9 +313,8 @@ export class UsersAdministrationComponent extends AutoCompletePlugin implements //user isResDestUser } else if (!user.inDiffListDest && user.isResDestUser) { - //update listInstances - this.http.put(this.coreUrl + 'rest/listinstances', user) + this.http.put(this.coreUrl + 'rest/listinstances', user.listinstances) .subscribe((data: any) => { if (data.errors) { this.notify.error(data.errors); @@ -417,10 +415,11 @@ export class UsersAdministrationRedirectModalComponent extends AutoCompletePlugi this.loadInstance = true; this.http.get(this.coreUrl + 'rest/listinstances/dest/itemId/' + this.data.userDestRedirect.user_id) .subscribe((dataInstance: any) => { - this.data.listinstances = dataInstance.listinstances; + this.data.listinstances = dataInstance; this.loadInstance = false; }); } + } sendFunction() {