`cursor` => `page`

This commit is contained in:
Roj Serbest 2021-10-22 20:24:02 +03:00
parent 80419db61a
commit b5af21488b
2 changed files with 10 additions and 7 deletions

View File

@ -4,5 +4,8 @@
"https://deno.land": true "https://deno.land": true
}, },
"editor.formatOnSave": true, "editor.formatOnSave": true,
"deno.config": "./deno.json" "deno.config": "./deno.json",
"[typescript]": {
"editor.defaultFormatter": "denoland.vscode-deno"
}
} }

View File

@ -30,15 +30,15 @@ export class Network extends MethodBase {
* Returns an array of peers who follow the given peer. * Returns an array of peers who follow the given peer.
* *
* @param peer The ID, handle (with a leading @) or instance of the peer. The default value is the authenticated user. * @param peer The ID, handle (with a leading @) or instance of the peer. The default value is the authenticated user.
* @param cursor The current cursor (page number) of the return results. The default value is `1`. * @param page The current page number of the return results. The default value is `1`.
*/ */
getFollowing(peer?: string | Peer, cursor?: number): Promise<Peer[]> { getFollowing(peer?: string | Peer, page?: number): Promise<Peer[]> {
return this.client.invokeRequest( return this.client.invokeRequest(
new Request("network.get_following", { new Request("network.get_following", {
peer: typeof peer !== "undefined" peer: typeof peer !== "undefined"
? typeof peer == "string" ? peer : peer.id ? typeof peer == "string" ? peer : peer.id
: undefined, : undefined,
cursor, page,
}), }),
true, true,
); );
@ -48,15 +48,15 @@ export class Network extends MethodBase {
* Returns an array of peers who follow the given peer. * Returns an array of peers who follow the given peer.
* *
* @param peer The ID, handle (with a leading @) or instance of the peer. The default value is the authenticated user. * @param peer The ID, handle (with a leading @) or instance of the peer. The default value is the authenticated user.
* @param cursor The current cursor (page number) of the return results. The default value is `1`. * @param page The current page number of the return results. The default value is `1`.
*/ */
getFollowers(peer?: string | Peer, cursor?: number): Promise<Peer[]> { getFollowers(peer?: string | Peer, page?: number): Promise<Peer[]> {
return this.client.invokeRequest( return this.client.invokeRequest(
new Request("network.get_followers", { new Request("network.get_followers", {
peer: typeof peer !== "undefined" peer: typeof peer !== "undefined"
? typeof peer == "string" ? peer : peer.id ? typeof peer == "string" ? peer : peer.id
: undefined, : undefined,
cursor, page,
}), }),
true, true,
); );