adding reducer and saga for employee
This commit is contained in:
@@ -5,20 +5,30 @@ import { Button, TextInput } from "react-native-paper";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import { signInEmployeeStart } from "../../redux/employee/employee.actions";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import {
|
||||
selectCurrentEmployee, selectSigningIn
|
||||
} from "../../redux/employee/employee.selectors";
|
||||
//TODO JF add props
|
||||
const mapStateToProps = (state) => ({});
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
currentEmployee: selectCurrentEmployee,
|
||||
signingIn: selectSigningIn,
|
||||
});
|
||||
|
||||
//TODO JF add prop functions to call dispatch with actions
|
||||
const mapDispatchToProps = {};
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
signInEmployeeStart: (employeeId, pin) =>
|
||||
dispatch(signInEmployeeStart({ employeeId, pin })),
|
||||
});
|
||||
|
||||
export function TechSignIn({ employeeSignInStart, employeeSigningIn }) {
|
||||
export function TechSignIn({ signInEmployeeStart, employeeSigningIn }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
//TODO add call to dispatch action
|
||||
const formSubmit = (values) => {
|
||||
const { employeeId, pin } = values;
|
||||
// techSignInStart(employeeId, pin);
|
||||
signInEmployeeStart(employeeId, pin);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user