MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / updateView

Method updateView

src/services/ViewStateManager.ts:263–285  ·  view source on GitHub ↗

* Update an existing saved view

(viewId: string, updates: Partial<SavedView>)

Source from the content-addressed store, hash-verified

261 * Update an existing saved view
262 */
263 updateView(viewId: string, updates: Partial<SavedView>): void {
264 const viewIndex = this.savedViews.findIndex((v) => v.id === viewId);
265 if (viewIndex === -1) {
266 throw new Error(`Saved view with ID ${viewId} not found`);
267 }
268
269 // Deep clone the query if it's being updated
270 const clonedUpdates = { ...updates };
271 if (clonedUpdates.query) {
272 clonedUpdates.query = FilterUtils.deepCloneFilterQuery(clonedUpdates.query);
273 }
274 if (clonedUpdates.viewOptions) {
275 clonedUpdates.viewOptions = { ...clonedUpdates.viewOptions };
276 }
277
278 this.savedViews[viewIndex] = {
279 ...this.savedViews[viewIndex],
280 ...clonedUpdates,
281 };
282
283 void this.saveSavedViewsToPluginData();
284 this.emit("saved-views-changed", this.getSavedViews());
285 }
286
287 /**
288 * Delete a saved view

Callers

nothing calls this directly

Calls 4

getSavedViewsMethod · 0.95
deepCloneFilterQueryMethod · 0.80
emitMethod · 0.80

Tested by

no test coverage detected