Function
getSnippetNamesForCreate
(
folderId: number | null,
)
Source from the content-addressed store, hash-verified
| 89 | } |
| 90 | |
| 91 | async function getSnippetNamesForCreate( |
| 92 | folderId: number | null, |
| 93 | ): Promise<string[]> { |
| 94 | const query: SnippetsQuery = { isDeleted: 0 } |
| 95 | if (folderId !== null) { |
| 96 | query.folderId = folderId |
| 97 | } |
| 98 | else { |
| 99 | query.isInbox = 1 |
| 100 | } |
| 101 | const { data } = await api.snippets.getSnippets(query) |
| 102 | |
| 103 | return data |
| 104 | .filter(snippet => (snippet.folder?.id ?? null) === folderId) |
| 105 | .map(snippet => snippet.name) |
| 106 | } |
| 107 | |
| 108 | const displayedSnippets = computed(() => { |
| 109 | if (isSearch.value) { |
Tested by
no test coverage detected