Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/endpoints/animes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export interface AnimesParams {
duration?: AnimeDuration;
rating?: AnimeRating;
genre?: string;
genre_v2?: string;
studio?: string;
franchise?: string;
censored?: boolean;
Expand Down
1 change: 1 addition & 0 deletions src/endpoints/mangas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface MangasParams {
season?: string;
score?: number;
genre?: string;
genre_v2?: string;
publisher?: string;
franchise?: string;
censored?: boolean;
Expand Down
17 changes: 13 additions & 4 deletions src/endpoints/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ export interface UsersListParams {
limit?: number;
}

export interface FriendsListParams {
id: UserId;
page?: number;
limit?: number;
}

export interface UsersByIdParams {
id: number | string;
is_nickname?: boolean;
Expand Down Expand Up @@ -57,7 +63,7 @@ export interface UsersHistoryParams {
* Users
* @param methods
*/
export const users = ({ get }: RequestMethods) => {
export const users = ({ get, post }: RequestMethods) => {
/**
* List users
* @param params
Expand Down Expand Up @@ -89,14 +95,17 @@ export const users = ({ get }: RequestMethods) => {
* Sign out from an account
* @param params
*/
const signOut = (): Promise<string> => get(`/users/sign_out`, {});
const signOut = (): Promise<string> => post(`/users/sign_out`, {});

/**
* List user's friends
* @param params
*/
const friends = ({ id }: Id<UserId>): Promise<UserBasic[]> =>
get(`/users/${id}/friends`, {});
const friends = ({
id,
...params
}: FriendsListParams): Promise<UserBasic[]> =>
get(`/users/${id}/friends`, params);

/**
* List user's clubs
Expand Down