Skip to content

Commit

Permalink
fix(api): don't mutate snippets table during embed folders
Browse files Browse the repository at this point in the history
  • Loading branch information
antonreshetov committed Apr 26, 2022
1 parent 6eeae53 commit f60d045
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/services/api/server.ts
Expand Up @@ -52,7 +52,10 @@ export class ApiServer {
})

app.get('/snippets/embed-folder', (req, res) => {
const snippets = router.db.get<SnippetWithFolder[]>('snippets').value()
const snippets = router.db
.get<SnippetWithFolder[]>('snippets')
.cloneDeep()
.value()

const result = snippets.map(i => {
const folder = router.db
Expand Down

0 comments on commit f60d045

Please sign in to comment.