jxp-helper 1.3.14 → 1.4.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/jxp-helper.js +8 -2
- package/package.json +5 -5
package/jxp-helper.js
CHANGED
|
@@ -147,7 +147,7 @@ class JXPHelper {
|
|
|
147
147
|
|
|
148
148
|
async bulk_postput(type, key, data) {
|
|
149
149
|
try {
|
|
150
|
-
if (!Array.isArray(data)) return await
|
|
150
|
+
if (!Array.isArray(data)) return await this.postput(type, key, data);
|
|
151
151
|
const updates = data.map(item => {
|
|
152
152
|
const updateQuery = {
|
|
153
153
|
"updateOne": {
|
|
@@ -156,7 +156,13 @@ class JXPHelper {
|
|
|
156
156
|
}
|
|
157
157
|
updateQuery.updateOne.update = item;
|
|
158
158
|
updateQuery.updateOne.filter = {};
|
|
159
|
-
|
|
159
|
+
if (Array.isArray(key)) {
|
|
160
|
+
key.forEach(k => {
|
|
161
|
+
updateQuery.updateOne.filter[k] = item[k];
|
|
162
|
+
});
|
|
163
|
+
} else {
|
|
164
|
+
updateQuery.updateOne.filter[key] = item[key];
|
|
165
|
+
}
|
|
160
166
|
return updateQuery;
|
|
161
167
|
});
|
|
162
168
|
const url = `${this.server}/bulkwrite/${type}?apikey=${this.apikey}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jxp-helper",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "A bunch of helpful functions for talking to a JXP API server ",
|
|
5
5
|
"main": "jxp-helper.js",
|
|
6
6
|
"scripts": {
|
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/
|
|
11
|
+
"url": "git+https://github.com/WorkSpaceMan/jxp-helper.git"
|
|
12
12
|
},
|
|
13
13
|
"author": "Jason Norwood-Young",
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"bugs": {
|
|
16
|
-
"url": "https://github.com/
|
|
16
|
+
"url": "https://github.com/WorkSpaceMan/jxp-helper/issues"
|
|
17
17
|
},
|
|
18
|
-
"homepage": "https://github.com/
|
|
18
|
+
"homepage": "https://github.com/WorkSpaceMan/jxp-helper#readme",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"axios": "^
|
|
20
|
+
"axios": "^1.4.0"
|
|
21
21
|
}
|
|
22
22
|
}
|