Skip to content

Commit

Permalink
CRM-7568: There was an error performing the requested operation when …
Browse files Browse the repository at this point in the history
…deleting email/phone for Contact by inline editing (#8432)

- edit routes in grid to use old API actions. Because new API usage causes a bug
- fix JS part so correct ID will be sent to the server. Before ID of contact instead of ContactEmail or ContactPhone was sent
  • Loading branch information
Aleksey Solonenko authored and Vladyslav Byndych committed Mar 15, 2017
1 parent 5a7d1df commit 6a53dd6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
10 changes: 2 additions & 8 deletions src/Oro/Bundle/ContactBundle/Resources/config/oro/datagrids.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,7 @@ datagrids:
name: oro_api_post_contact_email
http_method: POST
route_delete_entity:
name: oro_rest_api_delete_relationship
entityId: emailId
entity: contacts
association: emails
name: oro_api_delete_contact_email
http_method: DELETE
default_route_parameters:
className: Oro_Bundle_ContactBundle_Entity_ContactEmail
Expand All @@ -267,10 +264,7 @@ datagrids:
name: oro_api_post_contact_phone
http_method: POST
route_delete_entity:
name: oro_rest_api_delete_relationship
entityId: phoneId
entity: contacts
association: phones
name: oro_api_delete_contact_phone
http_method: DELETE
default_route_parameters:
className: Oro_Bundle_ContactBundle_Entity_ContactPhone
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ define(function(require) {
body.primary = true;
}

if (this.isActiveDeleteEntityRoute()) {
var routeOptions = this.initialOptions.route_delete_entity;
body = {data: [urlParameters[routeOptions.entityId]]};
urlParameters.entity = routeOptions.entity;
urlParameters.association = routeOptions.association;
}

return ContactApiAccessor.__super__.send.call(this, urlParameters, body, headers, options);
},

Expand Down Expand Up @@ -110,14 +103,6 @@ define(function(require) {
/** @returns {boolean} */
isActiveDeleteEntityRoute: function() {
return this.route.get('routeName') === this.initialOptions.route_delete_entity.name;
},

prepareUrlParameters: function(urlParameters) {
if (this.isActiveDeleteEntityRoute()) {
return urlParameters;
}

return ContactApiAccessor.__super__.prepareUrlParameters.apply(this, arguments);
}
});

Expand Down

0 comments on commit 6a53dd6

Please sign in to comment.