Comment on page
👥
Get Users
Use this method to get information of multiple users at same time such as Name, Bio, social etc. etc.
On success, the data is returned as JSON.
GetUsers
.Initialize(destroyAtEnd: true)
.SetParameters(
perPage: "20",
page: "1",
sortBy: "name",
sortDir: "asc"
)
.filter(//optional
name: "Altura",
)
.OnError(error => Debug.Log(error))
.OnComplete(result => Debug.Log(result))
.Run();
.Initialize()
Parameter | Type | Required | Description |
---|---|---|---|
destroyAtEnd | bool | Optional | defines if this component will be destroyed after .Run() |
.SetParameters()
Parameter | Type | Required | Description |
---|---|---|---|
perPage | String | Yes | Amount of users per page. |
page | String | Yes | Amount of pages |
sortBy | String | Yes | The field to sort the users by (any field in the user schema may be used) |
sortDir | String | Yes | Choose to sort in ascending (asc) or descending (desc) order |
.filter()
Parameter | Type | Required | Description |
---|---|---|---|
address | String | Optional | filter by user address |
name | String | Optional | filter by user Name |
bio | String | Optional | filter by user Bio |
.onError()
Action on Error: returns error information.
.onComplete()
.Run()
Runs the API call and fills the corresponding model in the component on success.
Last modified 11mo ago