mirror of
https://github.com/owncast/owncast.git
synced 2024-12-18 15:23:55 +03:00
23 lines
636 B
Go
23 lines
636 B
Go
package handlers
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/owncast/owncast/activitypub/persistence"
|
|
webutils "github.com/owncast/owncast/webserver/utils"
|
|
)
|
|
|
|
// GetFollowers will handle an API request to fetch the list of followers (non-activitypub response).
|
|
func GetFollowers(offset int, limit int, w http.ResponseWriter, r *http.Request) {
|
|
followers, total, err := persistence.GetFederationFollowers(limit, offset)
|
|
if err != nil {
|
|
webutils.WriteSimpleResponse(w, false, "unable to fetch followers")
|
|
return
|
|
}
|
|
|
|
response := webutils.PaginatedResponse{
|
|
Total: total,
|
|
Results: followers,
|
|
}
|
|
webutils.WriteResponse(w, response)
|
|
}
|