@tspvivek/baasix-sdk 0.1.0-alpha.7 → 0.1.0-alpha.8
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/dist/index.cjs +4 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/modules/items.cjs +4 -3
- package/dist/modules/items.cjs.map +1 -1
- package/dist/modules/items.d.cts +1 -1
- package/dist/modules/items.d.ts +1 -1
- package/dist/modules/items.js +4 -3
- package/dist/modules/items.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1495,14 +1495,15 @@ var ItemsModule = class {
|
|
|
1495
1495
|
*
|
|
1496
1496
|
* @example
|
|
1497
1497
|
* ```typescript
|
|
1498
|
-
* // Update by IDs
|
|
1498
|
+
* // Update by IDs with same data
|
|
1499
1499
|
* await items.updateMany(['id1', 'id2'], { status: 'archived' });
|
|
1500
1500
|
* ```
|
|
1501
1501
|
*/
|
|
1502
1502
|
async updateMany(ids, data) {
|
|
1503
|
+
const updates = ids.map((id) => ({ id, data }));
|
|
1503
1504
|
const response = await this.client.patch(
|
|
1504
1505
|
`/items/${this.collection}/bulk`,
|
|
1505
|
-
|
|
1506
|
+
updates
|
|
1506
1507
|
);
|
|
1507
1508
|
return response.data;
|
|
1508
1509
|
}
|
|
@@ -1545,7 +1546,7 @@ var ItemsModule = class {
|
|
|
1545
1546
|
*/
|
|
1546
1547
|
async deleteMany(ids) {
|
|
1547
1548
|
await this.client.delete(`/items/${this.collection}/bulk`, {
|
|
1548
|
-
|
|
1549
|
+
body: JSON.stringify(ids)
|
|
1549
1550
|
});
|
|
1550
1551
|
}
|
|
1551
1552
|
/**
|