@tthr/vue 0.0.79 → 0.0.81

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.
@@ -218,10 +218,12 @@ function createDatabaseProxy(apiKey, url, projectId) {
218
218
  const whereObj = options.where;
219
219
  // Support both _id (standard) and id (legacy) in where clause
220
220
  const id = whereObj?._id ?? whereObj?.id;
221
- if (!id) {
222
- throw new Error('Delete requires an _id in the where clause');
221
+ if (id) {
222
+ const result = await makeMutation('delete', { id });
223
+ return result?.rowsAffected ?? 0;
223
224
  }
224
- const result = await makeMutation('delete', { id });
225
+ // Compound where clause use deleteMany
226
+ const result = await makeMutation('deleteMany', { where: whereObj });
225
227
  return result?.rowsAffected ?? 0;
226
228
  },
227
229
  deleteById: async (id) => {
@@ -218,10 +218,12 @@ function createDatabaseProxy(apiKey, url, projectId) {
218
218
  const whereObj = options.where;
219
219
  // Support both _id (standard) and id (legacy) in where clause
220
220
  const id = whereObj?._id ?? whereObj?.id;
221
- if (!id) {
222
- throw new Error('Delete requires an _id in the where clause');
221
+ if (id) {
222
+ const result = await makeMutation('delete', { id });
223
+ return result?.rowsAffected ?? 0;
223
224
  }
224
- const result = await makeMutation('delete', { id });
225
+ // Compound where clause use deleteMany
226
+ const result = await makeMutation('deleteMany', { where: whereObj });
225
227
  return result?.rowsAffected ?? 0;
226
228
  },
227
229
  deleteById: async (id) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tthr/vue",
3
- "version": "0.0.79",
3
+ "version": "0.0.81",
4
4
  "description": "Tether Vue/Nuxt SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",