| 339 | } |
| 340 | |
| 341 | func handleValidate(dp *DataProvider) http.HandlerFunc { |
| 342 | return func(w http.ResponseWriter, r *http.Request) { |
| 343 | dp := effectiveDP(r, dp) |
| 344 | tasks, err := getFilteredTasks(dp, r) |
| 345 | if err != nil { |
| 346 | http.Error(w, err.Error(), http.StatusInternalServerError) |
| 347 | return |
| 348 | } |
| 349 | |
| 350 | v := validator.NewValidator(false) |
| 351 | result := v.Validate(tasks) |
| 352 | writeJSON(w, result) |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | // TaskUpdateRequest is the JSON request body for PUT /api/tasks/{id}. |
| 357 | type TaskUpdateRequest struct { |