File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -66,17 +66,9 @@ export const useSnippetStore = defineStore('snippets', {
6666
6767 actions : {
6868 async getSnippets ( ) {
69- // Почему то не работает _expand
70- const { data } = await useApi ( '/snippets?_expand=folder`' ) . get ( ) . json ( )
71- const { data : folderData } = await useApi ( '/folders' ) . get ( ) . json ( )
72-
73- // Поэтому добавляем folder самостоятельно
74- this . all = data . value . map ( ( i : SnippetWithFolder ) => {
75- const folder = folderData . value . find ( ( f : Folder ) => f . id === i . folderId )
76- if ( folder ) i . folder = folder
77- return i
78- } )
69+ const { data } = await useApi ( '/snippets/embed-folder' ) . get ( ) . json ( )
7970
71+ this . all = data . value
8072 this . all . sort ( ( a , b ) => ( a . updatedAt > b . updatedAt ? - 1 : 1 ) )
8173 } ,
8274 async getSnippetsByFolderIds ( ids : string [ ] ) {
You can’t perform that action at this time.
0 commit comments