@veritree/services 1.3.0 → 1.4.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.3.0",
3
+ "version": "1.4.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, args);
95
95
  }
96
96
 
97
97
  /**
@@ -101,8 +101,8 @@ export default class Api {
101
101
  * @param {string} as - 'put' // necessary for updates because of how Laravel handles PUT requests
102
102
  * @returns {promise}
103
103
  */
104
- async update(id, data, as = "put") {
105
- const url = `${this.getUrl(id)}${this.getUrlParams()}`;
104
+ async update(id, data, as = "put", args) {
105
+ const url = `${this.getUrl(id)}${this.getUrlParams(args)}`;
106
106
  return await this.post(url, data, as);
107
107
  }
108
108
 
@@ -113,8 +113,8 @@ export default class Api {
113
113
  * @param {string} as - 'put' // necessary for updates because of how Laravel handles PUT requests
114
114
  * @returns {promise}
115
115
  */
116
- async delete(id) {
117
- const url = `${this.getUrl(id)}${this.getUrlParams()}`;
116
+ async delete(id, args) {
117
+ const url = `${this.getUrl(id)}${this.getUrlParams(args)}`;
118
118
  return await this.post(url, null, "delete");
119
119
  }
120
120