MCPcopy Create free account
hub / github.com/driangle/taskmd / handleValidate

Function handleValidate

apps/cli/internal/web/handlers.go:341–354  ·  view source on GitHub ↗
(dp *DataProvider)

Source from the content-addressed store, hash-verified

339}
340
341func 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}.
357type TaskUpdateRequest struct {

Callers 2

registerRoutesMethod · 0.70
TestHandleValidateFunction · 0.70

Calls 5

ValidateMethod · 0.95
effectiveDPFunction · 0.85
getFilteredTasksFunction · 0.85
writeJSONFunction · 0.85
ErrorMethod · 0.80

Tested by 1

TestHandleValidateFunction · 0.56