web client v0.2 (add restaurant OK, settings OK)
This commit is contained in:
@@ -115,15 +115,22 @@ export const tryLogin = (username, password) => {
|
||||
dispatch(
|
||||
toggles.setLoggedIn(
|
||||
response.data.firstname,
|
||||
response.data.lastname,
|
||||
jwt,
|
||||
response.data.id,
|
||||
response.data.email
|
||||
response.data.email,
|
||||
response.data.NIP,
|
||||
response.data.adress,
|
||||
response.data.companyName,
|
||||
response.data.restaurants
|
||||
)
|
||||
);
|
||||
dispatch(push("/"));
|
||||
})
|
||||
.catch((err) => {
|
||||
if (err.response.status === 404) {
|
||||
if (!err.response) {
|
||||
console.log(err);
|
||||
} else if (err.response.status === 404) {
|
||||
dispatch(
|
||||
toggles.setLoginResult(
|
||||
"Użytkownik o podanym adresie email nie istnieje."
|
||||
|
||||
Reference in New Issue
Block a user