(type_s string, enabled bool)
| 37 | } |
| 38 | |
| 39 | func UpdateTaskDataFunc(type_s string, enabled bool) func([]byte) error { |
| 40 | if !enabled { |
| 41 | return nil |
| 42 | } |
| 43 | return func(data []byte) error { |
| 44 | s := string(data) |
| 45 | if s == "null" || s == "" { |
| 46 | s = "[]" |
| 47 | } |
| 48 | return UpdateTaskData(&model.TaskItem{Key: type_s, PersistData: s}) |
| 49 | } |
| 50 | } |
no test coverage detected