@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 (
|
|
222
|
-
|
|
221
|
+
if (id) {
|
|
222
|
+
const result = await makeMutation('delete', { id });
|
|
223
|
+
return result?.rowsAffected ?? 0;
|
|
223
224
|
}
|
|
224
|
-
|
|
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 (
|
|
222
|
-
|
|
221
|
+
if (id) {
|
|
222
|
+
const result = await makeMutation('delete', { id });
|
|
223
|
+
return result?.rowsAffected ?? 0;
|
|
223
224
|
}
|
|
224
|
-
|
|
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) => {
|