Added bodyshop querying before starting application. Basic job query and list view.
This commit is contained in:
@@ -15,8 +15,11 @@ import {
|
||||
updateUserDetailsSuccess,
|
||||
validatePasswordResetFailure,
|
||||
validatePasswordResetSuccess,
|
||||
setBodyshop,
|
||||
} from "./user.actions";
|
||||
import UserActionTypes from "./user.types";
|
||||
import { client } from "../../graphql/client";
|
||||
import { QUERY_BODYSHOP } from "../../graphql/bodyshop.queries";
|
||||
|
||||
export function* onEmailSignInStart() {
|
||||
yield takeLatest(UserActionTypes.EMAIL_SIGN_IN_START, signInWithEmail);
|
||||
@@ -75,7 +78,6 @@ export function* signOutStart() {
|
||||
|
||||
yield auth.signOut();
|
||||
yield put(signOutSuccess());
|
||||
localStorage.removeItem("token");
|
||||
} catch (error) {
|
||||
yield put(signOutFailure(error.message));
|
||||
}
|
||||
@@ -99,7 +101,13 @@ export function* onSignInSuccess() {
|
||||
}
|
||||
|
||||
export function* signInSuccessSaga({ payload }) {
|
||||
//yield logImEXEvent("redux_sign_in_success");
|
||||
try {
|
||||
const shop = yield client.query({ query: QUERY_BODYSHOP });
|
||||
|
||||
yield put(setBodyshop(shop.data.bodyshops[0]));
|
||||
} catch (error) {
|
||||
console.log("UHOH. Couldn't get shop details.", error);
|
||||
}
|
||||
}
|
||||
|
||||
export function* onSendPasswordResetStart() {
|
||||
|
||||
Reference in New Issue
Block a user