mirror of
https://github.com/status-im/fathom.git
synced 2025-03-01 11:30:28 +00:00
19 lines
379 B
Go
19 lines
379 B
Go
package api
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/usefathom/fathom/pkg/datastore"
|
|
)
|
|
|
|
// URL: /api/bounces/count
|
|
var GetBouncesCountHandler = HandlerFunc(func(w http.ResponseWriter, r *http.Request) error {
|
|
before, after := getRequestedPeriods(r)
|
|
result, err := datastore.TotalBounces(before, after)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return respond(w, envelope{Data: result})
|
|
})
|