This commit is contained in:
Liang Ding 2022-10-12 09:13:40 +08:00
parent ee413a6352
commit 5aa5764974
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 6 additions and 8 deletions

View file

@ -42,8 +42,9 @@ func getSnippet(c *gin.Context) {
enabled = false
}
confSnippets := model.LoadSnippets()
var snippets []*conf.Snippet
for _, s := range model.Snippets {
for _, s := range confSnippets {
if ("all" == typ || s.Type == typ) && (2 == enabledArg || s.Enabled == enabled) {
snippets = append(snippets, s)
}