mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-16 08:04:10 +00:00
feat: able to delete all manually disabled channels (close #539)
This commit is contained in:
@@ -127,6 +127,23 @@ func DeleteChannel(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
func DeleteManuallyDisabledChannel(c *gin.Context) {
|
||||
rows, err := model.DeleteChannelByStatus(common.ChannelStatusManuallyDisabled)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"success": false,
|
||||
"message": err.Error(),
|
||||
})
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"success": true,
|
||||
"message": "",
|
||||
"data": rows,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func UpdateChannel(c *gin.Context) {
|
||||
channel := model.Channel{}
|
||||
err := c.ShouldBindJSON(&channel)
|
||||
|
Reference in New Issue
Block a user