Remove Api.createEntity
authorFrank Bessou <frank.bessou@logilab.fr>
Thu, 04 May 2017 17:21:01 +0200
changeset 180 99abdceaf645
parent 179 fbb644088c11
child 181 6aa82b1bd05e
Remove Api.createEntity
src/Api.js
--- a/src/Api.js	Thu May 04 17:16:27 2017 +0200
+++ b/src/Api.js	Thu May 04 17:21:01 2017 +0200
@@ -51,27 +51,6 @@
         });
     }
 
-    createEntity(etype, attributes, ...files) {
-        const url = `/${etype}/`;
-        const headers = {};
-        const attrs = JSON.stringify(attributes);
-        let body;
-        if (files.length === 0) {
-            headers['Content-Type'] = 'application/json';
-            body = attrs;
-        } else {
-            body = new FormData();
-            body.append('data', attrs);
-            files.forEach(([rtype, file]) => body.append(rtype, file));
-        }
-        const options = {
-            method: 'POST',
-            headers: headers,
-            body: body,
-        };
-        return this.hypermediaClient.jsonFetch(url, options);
-    }
-
     relateEntity(etype, eid, rtype, attributes, targetType = null) {
         let url = `/${etype}/${eid}/relationships/${rtype}`;
         const options = {