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

Function getSnippetNamesForCreate

src/renderer/composables/useSnippets.ts:91–106  ·  view source on GitHub ↗
(
  folderId: number | null,
)

Source from the content-addressed store, hash-verified

89}
90
91async 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
108const displayedSnippets = computed(() => {
109 if (isSearch.value) {

Callers 1

createSnippetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected