@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.cjs
CHANGED
|
@@ -1497,14 +1497,15 @@ var ItemsModule = class {
|
|
|
1497
1497
|
*
|
|
1498
1498
|
* @example
|
|
1499
1499
|
* ```typescript
|
|
1500
|
-
* // Update by IDs
|
|
1500
|
+
* // Update by IDs with same data
|
|
1501
1501
|
* await items.updateMany(['id1', 'id2'], { status: 'archived' });
|
|
1502
1502
|
* ```
|
|
1503
1503
|
*/
|
|
1504
1504
|
async updateMany(ids, data) {
|
|
1505
|
+
const updates = ids.map((id) => ({ id, data }));
|
|
1505
1506
|
const response = await this.client.patch(
|
|
1506
1507
|
`/items/${this.collection}/bulk`,
|
|
1507
|
-
|
|
1508
|
+
updates
|
|
1508
1509
|
);
|
|
1509
1510
|
return response.data;
|
|
1510
1511
|
}
|
|
@@ -1547,7 +1548,7 @@ var ItemsModule = class {
|
|
|
1547
1548
|
*/
|
|
1548
1549
|
async deleteMany(ids) {
|
|
1549
1550
|
await this.client.delete(`/items/${this.collection}/bulk`, {
|
|
1550
|
-
|
|
1551
|
+
body: JSON.stringify(ids)
|
|
1551
1552
|
});
|
|
1552
1553
|
}
|
|
1553
1554
|
/**
|