-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Алексей Левчук Lesson7 #64
base: master
Are you sure you want to change the base?
Changes from all commits
7fa03fc
0e6dfd4
0219171
a3f8979
6fed832
e10b980
095a0e7
8725f18
8e11e5f
ad891a6
985d46f
aec470b
c390918
aa31af8
904a13e
039462d
e16ecd4
efd23e5
44546c4
72dba84
7367d2a
811b0fa
4d8e13b
5bd9a7d
f661993
8bd4a69
44fa0e2
fd15f55
bebb426
460b9c1
2faa92a
03c897c
8009ad8
c3753e4
d56a0a5
5f2b3ef
70ad004
a13a2be
368adbb
a8d3b43
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
export const RECEIVE_USERS = 'RECEIVE_USERS' | ||
export const ADD_USER = 'ADD_USER' | ||
import axios from 'axios' | ||
|
||
|
||
export const getUsers = () => dispatch => { | ||
return axios.get(`https://jsonplaceholder.typicode.com/users`) | ||
.then(response => response.data) | ||
.then(json => dispatch( | ||
{ | ||
type: RECEIVE_USERS, | ||
users: json, | ||
} | ||
)) | ||
} | ||
|
||
export const addUser = () => dispatch => { | ||
return dispatch( | ||
{ | ||
type: ADD_USER, | ||
user: { | ||
username: "newUsername", | ||
name: "newName", | ||
email: "newEmail", | ||
phone: "newPhone" | ||
}, | ||
} | ||
) | ||
} | ||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.