@shisyamo4131/air-guard-v2-schemas 1.3.1-dev.14 → 1.3.1-dev.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shisyamo4131/air-guard-v2-schemas",
3
- "version": "1.3.1-dev.14",
3
+ "version": "1.3.1-dev.15",
4
4
  "description": "Schemas for AirGuard V2",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -230,10 +230,12 @@ export default class OperationBilling extends OperationResult {
230
230
  if (typeof value !== "boolean") {
231
231
  throw new Error("Invalid value provided to toggleLock method");
232
232
  }
233
- const firestore = this.getAdapter().firestore;
234
- const colPath = this.getCollectionPath();
235
- const colRef = collection(firestore, colPath);
236
- const docRef = doc(colRef, docId);
237
- await updateDoc(docRef, { isLocked: value });
233
+ const instance = new OperationBilling();
234
+ const doc = await instance.fetchDoc({ docId });
235
+ if (!doc) {
236
+ throw new Error(`OperationResult document with ID ${docId} not found`);
237
+ }
238
+ doc.isLocked = value;
239
+ await doc.update();
238
240
  }
239
241
  }