(snippetId: number, data: SnippetsUpdate)
| 457 | } |
| 458 | |
| 459 | async 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 | |
| 473 | async function updateSnippets(snippetIds: number[], data: SnippetsUpdate[]) { |
| 474 | markPersistedStorageMutation() |
no test coverage detected