Skip to content

Commit 12f2416

Browse files
committed
Added service for docs
1 parent 8519cbb commit 12f2416

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/services/api.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import axios from 'axios'
2+
const API_URL = `https://reqres.in/api`
3+
4+
/**
5+
* Function to get a users from API
6+
* @param {Number} page
7+
* @return AxiosPromise
8+
*/
9+
export const getUsers = (page = 1) => {
10+
return axios.get(`${API_URL}/users?per_page=10&page=${page}`)
11+
}

0 commit comments

Comments
 (0)