MCPcopy Create free account
hub / github.com/massCodeIO/massCode / updateSnippet

Function updateSnippet

src/renderer/composables/useSnippets.ts:459–471  ·  view source on GitHub ↗
(snippetId: number, data: SnippetsUpdate)

Source from the content-addressed store, hash-verified

457}
458
459async function updateSnippet(snippetId: number, data: SnippetsUpdate) {
460 markPersistedStorageMutation()
461 await api.snippets.patchSnippetsById(String(snippetId), data)
462
463 if (isSnippetListMembershipAffecting(data)) {
464 await getSnippets(queryByLibraryOrFolderOrSearch.value)
465 await refreshSelectedSnippet()
466 return
467 }
468
469 // Переименование/описание не меняют состав списка — обновляем точечно.
470 patchSnippetInCollections(snippetId, data)
471}
472
473async function updateSnippets(snippetIds: number[], data: SnippetsUpdate[]) {
474 markPersistedStorageMutation()

Callers 2

deleteSelectedSnippetsFunction · 0.85

Calls 5

refreshSelectedSnippetFunction · 0.85
getSnippetsFunction · 0.70

Tested by

no test coverage detected