|
|
|
@ -151,11 +151,13 @@ func main() { |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
e.POST("/:id/report", func(c echo.Context) error { |
|
|
|
e.POST("/:id/report", func(c echo.Context) error { |
|
|
|
if legitAccess(c) { |
|
|
|
report := c.FormValue("report") |
|
|
|
err := email(c.Param("id"), c.FormValue("report")) |
|
|
|
if legitAccess(c) && report != "" { |
|
|
|
if err != nil { |
|
|
|
id := c.Param("id") |
|
|
|
|
|
|
|
if err := email(id, report); err != nil { |
|
|
|
c.Logger().Errorf("couldn't send email: %v", err) |
|
|
|
c.Logger().Errorf("couldn't send email: %v", err) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
c.Logger().Debugf("note %s was reported", id) |
|
|
|
} |
|
|
|
} |
|
|
|
return c.NoContent(http.StatusNoContent) |
|
|
|
return c.NoContent(http.StatusNoContent) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|