Handle pagination for the federated actions & followers responses (#1731)
* Add pagination for admin social list * Use Paginated API for followers tab on frontend
This commit is contained in:
@@ -47,6 +47,9 @@ INSERT INTO ap_outbox(iri, value, type, live_notification) values($1, $2, $3, $4
|
||||
-- name: AddToAcceptedActivities :exec
|
||||
INSERT INTO ap_accepted_activities(iri, actor, type, timestamp) values($1, $2, $3, $4);
|
||||
|
||||
-- name: GetInboundActivityCount :one
|
||||
SELECT count(*) FROM ap_accepted_activities;
|
||||
|
||||
-- name: GetInboundActivitiesWithOffset :many
|
||||
SELECT iri, actor, type, timestamp FROM ap_accepted_activities ORDER BY timestamp DESC LIMIT $1 OFFSET $2;
|
||||
|
||||
|
||||
@@ -280,6 +280,17 @@ func (q *Queries) GetInboundActivitiesWithOffset(ctx context.Context, arg GetInb
|
||||
return items, nil
|
||||
}
|
||||
|
||||
const getInboundActivityCount = `-- name: GetInboundActivityCount :one
|
||||
SELECT count(*) FROM ap_accepted_activities
|
||||
`
|
||||
|
||||
func (q *Queries) GetInboundActivityCount(ctx context.Context) (int64, error) {
|
||||
row := q.db.QueryRowContext(ctx, getInboundActivityCount)
|
||||
var count int64
|
||||
err := row.Scan(&count)
|
||||
return count, err
|
||||
}
|
||||
|
||||
const getLocalPostCount = `-- name: GetLocalPostCount :one
|
||||
SElECT count(*) FROM ap_outbox
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user