mirror of
https://github.com/owncast/owncast.git
synced 2024-10-10 19:16:02 +00:00
23 lines
557 B
Go
23 lines
557 B
Go
package controllers
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/owncast/owncast/activitypub/persistence"
|
|
)
|
|
|
|
// 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 {
|
|
WriteSimpleResponse(w, false, "unable to fetch followers")
|
|
return
|
|
}
|
|
|
|
response := PaginatedResponse{
|
|
Total: total,
|
|
Results: followers,
|
|
}
|
|
WriteResponse(w, response)
|
|
}
|