@veritree/services 1.5.0-7 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veritree/services",
3
- "version": "1.5.0-7",
3
+ "version": "2.0.0",
4
4
  "description": "A collection of javascript functions/services to talk to veritree API",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -90,8 +90,8 @@ export default class Api {
90
90
  * @param {object} data
91
91
  * @returns {promise}
92
92
  */
93
- async create(data) {
94
- return await this.post(null, data);
93
+ async create(data, args) {
94
+ return await this.post(null, data, null, args);
95
95
  }
96
96
 
97
97
  /**
@@ -133,8 +133,8 @@ export default class Api {
133
133
  * @param {object} data
134
134
  * @returns {promise}
135
135
  */
136
- async post(url, data, as) {
137
- if (!url) url = `${this.getUrl()}${this.getUrlParams()}`;
136
+ async post(url, data, as, args) {
137
+ if (!url) url = `${this.getUrl()}${this.getUrlParams(args)}`;
138
138
  return await this.unWrap(url, "post", data, as);
139
139
  }
140
140
 
@@ -31,7 +31,7 @@ const Team = (api, id) => {
31
31
 
32
32
  const remove = async (userId) => {
33
33
  url = `${url}/${userId}${api.getUrlParams()}`;
34
- return await api.delete(url);
34
+ return await api.post(url, null, "delete");
35
35
  }
36
36
 
37
37
  return {