Remove deleteEntity method from Api
authorFrank Bessou <frank.bessou@logilab.fr>
Fri, 28 Apr 2017 16:08:02 +0200
changeset 161 b26c54547826
parent 160 8e40616ccb29
child 162 1960d7fa8edf
Remove deleteEntity method from Api Use deleteResource from hypermediaClient instead.
src/Api.js
src/components/Entity.js
--- a/src/Api.js	Fri Apr 28 16:00:16 2017 +0200
+++ b/src/Api.js	Fri Apr 28 16:08:02 2017 +0200
@@ -101,11 +101,6 @@
         return this.hypermediaClient.jsonFetch(url, options);
     }
 
-    deleteEntity(etype, eid) {
-        const url = `/${etype}/${eid}`;
-        return this.hypermediaClient.deleteResource(url);
-    }
-
     getTransitionsSchema(etype, eid) {
         const url = `/${etype}/${eid}/transitions/schema?role=creation`;
         return this.hypermediaClient.jsonSchemaFetch(url);
--- a/src/components/Entity.js	Fri Apr 28 16:00:16 2017 +0200
+++ b/src/components/Entity.js	Fri Apr 28 16:08:02 2017 +0200
@@ -198,7 +198,7 @@
     }
 
     deleteEntity() {
-        Api.deleteEntity(this.getEType(), this.getEID())
+        HypermediaClient.deleteResource(this.state.entity.route)
             .then( () => {
                 this.navigateToParent();
             });