MCPcopy Create free account
hub / github.com/QuantumNous/new-api / SetTaskPluginEnabled

Function SetTaskPluginEnabled

model/task_plugin.go:183–192  ·  view source on GitHub ↗
(key string, enabled bool)

Source from the content-addressed store, hash-verified

181}
182
183func SetTaskPluginEnabled(key string, enabled bool) error {
184 result := DB.Model(&TaskPlugin{}).Where(&TaskPlugin{Key: key, Active: true}).Update("enabled", enabled)
185 if result.Error != nil {
186 return result.Error
187 }
188 if result.RowsAffected == 0 {
189 return gorm.ErrRecordNotFound
190 }
191 return nil
192}
193
194type TaskPluginDeleteResult struct {
195 DeletedActive bool

Calls 1

UpdateMethod · 0.45