@veritree/services 1.5.0-8 → 2.0.1
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 +1 -1
- package/src/helpers/api.js +8 -5
package/package.json
CHANGED
package/src/helpers/api.js
CHANGED
|
@@ -26,7 +26,7 @@ function addVersionArg(url) {
|
|
|
26
26
|
*/
|
|
27
27
|
function getConfig(method, data, as) {
|
|
28
28
|
const isGet = method === "get";
|
|
29
|
-
const isSpoofing = as
|
|
29
|
+
const isSpoofing = as;
|
|
30
30
|
const isFormData = data instanceof FormData;
|
|
31
31
|
const accessToken = `Bearer ${getCookie("access_token")}`;
|
|
32
32
|
|
|
@@ -90,8 +90,9 @@ export default class Api {
|
|
|
90
90
|
* @param {object} data
|
|
91
91
|
* @returns {promise}
|
|
92
92
|
*/
|
|
93
|
-
async create(data) {
|
|
94
|
-
|
|
93
|
+
async create(data, args) {
|
|
94
|
+
console.log(1);
|
|
95
|
+
return await this.post(null, data, null, args);
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
/**
|
|
@@ -133,8 +134,10 @@ export default class Api {
|
|
|
133
134
|
* @param {object} data
|
|
134
135
|
* @returns {promise}
|
|
135
136
|
*/
|
|
136
|
-
async post(url, data, as) {
|
|
137
|
-
|
|
137
|
+
async post(url, data, as, args) {
|
|
138
|
+
// console.log(args);
|
|
139
|
+
if (!url) url = `${this.getUrl()}${this.getUrlParams(args)}`;
|
|
140
|
+
console.log(url);
|
|
138
141
|
return await this.unWrap(url, "post", data, as);
|
|
139
142
|
}
|
|
140
143
|
|