MCPcopy
hub / github.com/makeplane/plane / save

Function save

packages/services/src/indexedDB.service.ts:36–54  ·  view source on GitHub ↗
(workspaces: any[])

Source from the content-addressed store, hash-verified

34 }
35
36 async save(workspaces: any[]): Promise<void> {
37 if (!this.db) throw new Error("Database not initialized");
38
39 const transaction = this.db.transaction("workspaces", "readwrite");
40 const store = transaction.objectStore("workspaces");
41
42 return new Promise((resolve, reject) => {
43 // Clear existing data
44 store.clear();
45
46 // Add new workspaces
47 workspaces.forEach((workspace) => {
48 store.add(workspace);
49 });
50
51 transaction.oncomplete = () => resolve();
52 transaction.onerror = () => reject(transaction.error);
53 });
54 }
55
56 async query(): Promise<any[]> {
57 if (!this.db) throw new Error("Database not initialized");

Callers

nothing calls this directly

Calls 2

addMethod · 0.80
clearMethod · 0.65

Tested by

no test coverage detected