qranswers 1.0.21 → 1.0.22
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/lib/Api.js +3 -2
- package/package.json +1 -1
package/lib/Api.js
CHANGED
|
@@ -11,10 +11,11 @@ const Api = {
|
|
|
11
11
|
initialize() {
|
|
12
12
|
// do nothing..
|
|
13
13
|
},
|
|
14
|
-
async doFetch(url) {
|
|
14
|
+
async doFetch(url, method) {
|
|
15
15
|
|
|
16
16
|
try {
|
|
17
17
|
const result = await fetch(url, {
|
|
18
|
+
method: method || 'GET',
|
|
18
19
|
headers: {
|
|
19
20
|
Accept: '*/*',
|
|
20
21
|
'Authorization': this._apiKey,
|
|
@@ -106,7 +107,7 @@ const Api = {
|
|
|
106
107
|
},
|
|
107
108
|
async resetNotificationAggregate(id, idType, fieldName) {
|
|
108
109
|
const url = `${this._apiBase}/notifications/aggregate/reset/${encodeURIComponent(id)}/${encodeURIComponent(idType)}?fieldName=${encodeURIComponent(fieldName)}`;
|
|
109
|
-
return await this.doFetch(url)
|
|
110
|
+
return await this.doFetch(url, 'PUT')
|
|
110
111
|
}
|
|
111
112
|
|
|
112
113
|
}
|