Skip to main content

Function: listByAuthorHandler()

listByAuthorHandler(c, params): Promise<{ cursor: string; hasMore: boolean; preprints: object[]; total: number; }>

Defined in: src/api/handlers/xrpc/preprint/listByAuthor.ts:51

Handler for pub.chive.preprint.listByAuthor query.

Parameters

c

Context<ChiveEnv>

Hono context with Chive environment

params

Validated query parameters with author DID

cursor

string = ...

Pagination cursor for next page.

did

string = ...

limit

number = ...

Maximum items to return.

sort

"date" | "views" = ...

Returns

Promise<{ cursor: string; hasMore: boolean; preprints: object[]; total: number; }>

Paginated list of author's preprints

Example

GET /xrpc/pub.chive.preprint.listByAuthor?did=did:plc:abc&limit=20&sort=date

Response:
{
"preprints": [...],
"hasMore": true,
"cursor": "...",
"total": 45
}