🐛 fix: No model returns empty array

This commit is contained in:
Martial BE 2024-04-02 11:18:25 +08:00
parent efb8a9f296
commit c7387dd5b1
No known key found for this signature in database
GPG Key ID: D06C32DF0EDB9084

View File

@ -59,7 +59,10 @@ func ListModels(c *gin.Context) {
models, err := model.ChannelGroup.GetGroupModels(groupName)
if err != nil {
common.AbortWithMessage(c, http.StatusServiceUnavailable, err.Error())
c.JSON(200, gin.H{
"object": "list",
"data": []string{},
})
return
}
sort.Strings(models)