MCPcopy
hub / github.com/usefathom/fathom / DeleteSiteHandler

Method DeleteSiteHandler

pkg/api/sites.go:63–75  ·  view source on GitHub ↗

DELETE /api/sites/{id}

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

61
62// DELETE /api/sites/{id}
63func (api *API) DeleteSiteHandler(w http.ResponseWriter, r *http.Request) error {
64 vars := mux.Vars(r)
65 id, err := strconv.ParseInt(vars["id"], 10, 64)
66 if err != nil {
67 return err
68 }
69
70 if err := api.database.DeleteSite(&models.Site{ID: id}); err != nil {
71 return err
72 }
73
74 return respond(w, http.StatusOK, envelope{Data: true})
75}
76
77func generateTrackingID() string {
78 return randomString(5)

Callers

nothing calls this directly

Calls 2

respondFunction · 0.85
DeleteSiteMethod · 0.65

Tested by

no test coverage detected