Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
fix: set a default value for the type parameter when searching users
Browse files Browse the repository at this point in the history
  • Loading branch information
szdc committed Nov 24, 2018
1 parent 4a8c9db commit 12738dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ export default class TikTokAPI {
*/
searchUsers = (params: API.UserSearchRequest) =>
this.request.get<API.UserSearchResponse | API.BaseResponseData>('aweme/v1/discover/search/', {
params: withDefaultListParams(params),
params: <API.UserSearchRequest>{
type: 1,
...withDefaultListParams(params),
},
})

/**
Expand Down
2 changes: 1 addition & 1 deletion src/types/search.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface SearchRequest extends ListRequestParams, CountOffsetParams {
}

export interface UserSearchRequest extends SearchRequest {
/** The scope of the search - users = 1 */
/** Required - the scope of the search - users = 1. */
type?: number;
}

Expand Down

0 comments on commit 12738dd

Please sign in to comment.