web client v0.2 (add restaurant OK, settings OK)

This commit is contained in:
2020-09-19 18:16:26 +02:00
parent 732ad74657
commit 68ecf13aa1
16 changed files with 546 additions and 86 deletions

View File

@@ -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."