add a couple post endpoints + /timelines/home

This commit is contained in:
sam 2023-09-06 16:32:33 +02:00
parent dd72a1f4c1
commit 9f052dc9ef
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
24 changed files with 462 additions and 32 deletions

View file

@ -84,3 +84,13 @@ func (s *BlogStore) LocalCount(ctx context.Context) (count int64, err error) {
}
return count, nil
}
func (s *BlogStore) Followers(ctx context.Context, id ulid.ULID) ([]ulid.ULID, error) {
q := sqlf.Sprintf("SELECT account_id FROM account_follows WHERE blog_id = %s", id)
follows, err := Select[ulid.ULID](ctx, s.q, q)
if err != nil {
return nil, errors.Wrap(err, "executing query")
}
return follows, nil
}