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

Function handleGraph

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

Source from the content-addressed store, hash-verified

220}
221
222func handleGraph(dp *DataProvider) http.HandlerFunc {
223 return func(w http.ResponseWriter, r *http.Request) {
224 dp := effectiveDP(r, dp)
225 tasks, err := getFilteredTasks(dp, r)
226 if err != nil {
227 http.Error(w, err.Error(), http.StatusInternalServerError)
228 return
229 }
230
231 g := graph.NewGraph(tasks)
232 writeJSON(w, g.ToJSON())
233 }
234}
235
236func handleGraphMermaid(dp *DataProvider) http.HandlerFunc {
237 return func(w http.ResponseWriter, r *http.Request) {

Callers 2

registerRoutesMethod · 0.70
TestHandleGraphFunction · 0.70

Calls 5

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

Tested by 1

TestHandleGraphFunction · 0.56