connected-react-router#goBack JavaScript Examples

The following examples show how to use connected-react-router#goBack. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.js    From HexactaLabs-NetCore_React-Initial with Apache License 2.0 6 votes vote down vote up
export function update(provider) {
  return function(dispatch) {
    dispatch(setLoading(true));
    return api
      .put(`/provider/${provider.id}`, provider)
      .then(() => {
        toast.success("El proveedor se editó con éxito");
        dispatch(success(provider));
        dispatch(setLoading(false));
        return dispatch(goBack());
      })
      .catch(error => {
        apiErrorToast(error);
        return dispatch(setLoading(false));
      });
  };
}
Example #2
Source File: index.js    From HexactaLabs-NetCore_React-Level2 with Apache License 2.0 6 votes vote down vote up
Create = ({ create: onSubmit, goBack: onCancel }) => {
  return (
    <Container fluid>
      <Row>
        <h2>Nuevo Tipo Producto</h2>
      </Row>
      <Row>
        <Col>
          <Form onSubmit={onSubmit} handleCancel={onCancel} />
        </Col>
      </Row>
    </Container>
  );
}
Example #3
Source File: index.js    From HexactaLabs-NetCore_React-Initial with Apache License 2.0 6 votes vote down vote up
export function update(store) {
  return function(dispatch) {
    dispatch(setLoading(true));
    return api
      .put(`/store/${store.id}`, store)
      .then(() => {
        toast.success("La tienda se editó con éxito");
        dispatch(success(store));
        dispatch(setLoading(false));
        return dispatch(goBack());
      })
      .catch(error => {
        apiErrorToast(error);
        return dispatch(setLoading(false));
      });
  };
}
Example #4
Source File: index.js    From HexactaLabs-NetCore_React-Level1 with Apache License 2.0 6 votes vote down vote up
Update = ({ initialValues, update: onSubmit, goBack: onCancel }) => {
  return (
    <Container fluid>
      <Row>
        <Col>
          <div className="block-header">
            <h1>Edición</h1>
          </div>
        </Col>
      </Row>
      <Row>
        <Col>
          <Form
            initialValues={initialValues}
            onSubmit={onSubmit}
            handleCancel={onCancel}
          />
        </Col>
      </Row>
    </Container>
  );
}
Example #5
Source File: index.js    From HexactaLabs-NetCore_React-Level2 with Apache License 2.0 6 votes vote down vote up
Update = ({ initialValues, update: onSubmit, goBack: onCancel }) => {
  return (
    <Container fluid>
      <Row>
        <Col>
            <div className="block-header">
                <h1>Edición</h1>
            </div>
        </Col>
      </Row>
      <Row>
        <Col>
          <Form
            initialValues={initialValues}
            onSubmit={onSubmit}
            handleCancel={onCancel}
          />
        </Col>
      </Row>
    </Container>
  );
}
Example #6
Source File: index.js    From HexactaLabs-NetCore_React-Initial with Apache License 2.0 6 votes vote down vote up
export function create(store) {
  return function(dispatch) {
    dispatch(setLoading(true));
    return api
      .post(`/store/`, store)
      .then(response => {
        toast.success("La tienda se creó con éxito");
        dispatch(success(response.data.data));
        dispatch(setLoading(false));
        return dispatch(goBack());
      })
      .catch(error => {
        apiErrorToast(error);
        return dispatch(setLoading(false));
      });
  };
}
Example #7
Source File: index.js    From HexactaLabs-NetCore_React-Level1 with Apache License 2.0 6 votes vote down vote up
export function update(producttype) {
  return function (dispatch) {
    dispatch(setLoading(true));
    return api
      .put(`/producttype/${producttype.id}`, producttype)
      .then(() => {
        toast.success("El tupo de producto se editó con éxito");
        dispatch(success(producttype));
        dispatch(setLoading(false));
        return dispatch(goBack());
      })
      .catch((error) => {
        apiErrorToast(error);
        return dispatch(setLoading(false));
      });
  };
}
Example #8
Source File: index.js    From HexactaLabs-NetCore_React-Initial with Apache License 2.0 6 votes vote down vote up
Create = ({ create: onSubmit, goBack: onCancel }) => {
  return (
    <Container fluid>
      <Row>
        <h2>Nueva Tienda</h2>
      </Row>
      <Row>
        <Col>
          <Form onSubmit={onSubmit} handleCancel={onCancel} />
        </Col>
      </Row>
    </Container>
  );
}
Example #9
Source File: index.js    From HexactaLabs-NetCore_React-Level1 with Apache License 2.0 6 votes vote down vote up
Create = ({ create: onSubmit, goBack: onCancel }) => {
  return (
    <Container fluid>
      <Row>
        <div className="block-header">
          <h2>Nuevo Tipo de Producto</h2>
        </div>
      </Row>
      <Row>
        <Col>
          <Form onSubmit={onSubmit} handleCancel={onCancel} />
        </Col>
      </Row>
    </Container>
  );
}
Example #10
Source File: index.js    From HexactaLabs-NetCore_React-Final with Apache License 2.0 6 votes vote down vote up
export function update(product) {
  return function(dispatch) {
    dispatch(setLoading(true));
    return api
      .put(`/product/${product.id}`, product)
      .then(() => {
        toast.success("El producto se editó con exito");
        dispatch(success(product));
        dispatch(setLoading(false));
        return dispatch(goBack());
      })
      .catch(error => {
        apiErrorToast(error);
        return dispatch(setLoading(false));
      });
  };
}
Example #11
Source File: index.js    From HexactaLabs-NetCore_React-Initial with Apache License 2.0 6 votes vote down vote up
Update = ({ initialValues, update: onSubmit, goBack: onCancel }) => {
  return (
    <Container fluid>
      <Row>
          <Col>
            <div className="block-header">
                <h1>Edición</h1>
            </div>
        </Col>
      </Row>
      <Row>
        <Col>
          <Form
            initialValues={initialValues}
            onSubmit={onSubmit}
            handleCancel={onCancel}
          />
        </Col>
      </Row>
    </Container>
  );
}
Example #12
Source File: index.js    From HexactaLabs-NetCore_React-Level2 with Apache License 2.0 6 votes vote down vote up
export function update(producttype) {
  return function (dispatch) {
    dispatch(setLoading(true));
    return api
      .put(`/producttype/${producttype.id}`, producttype)
      .then(() => {
        toast.success("El tipo de producto se editó con exito");
        dispatch(success(producttype));
        dispatch(setLoading(false));
        return dispatch(goBack());
      })
      .catch(() => {
        return dispatch(setLoading(false));
      });
  };
}
Example #13
Source File: index.js    From HexactaLabs-NetCore_React-Initial with Apache License 2.0 6 votes vote down vote up
export function create(provider) {
  return function(dispatch) {
    dispatch(setLoading(true));
    return api
      .post(`/provider/`, provider)
      .then(response => {
        toast.success("El proveedor se creó con éxito");
        dispatch(success(response.data.data));
        dispatch(setLoading(false));
        return dispatch(goBack());
      })
      .catch(error => {
        apiErrorToast(error);
        return dispatch(setLoading(false));
      });
  };
}
Example #14
Source File: index.js    From HexactaLabs-NetCore_React-Level1 with Apache License 2.0 6 votes vote down vote up
Update = ({ initialValues, update: onSubmit, goBack: onCancel }) => {
  return (
    <Container fluid>
      <Row>
          <Col>
            <div className="block-header">
                <h1>Edición</h1>
            </div>
        </Col>
      </Row>
      <Row>
        <Col>
          <Form
            initialValues={initialValues}
            onSubmit={onSubmit}
            handleCancel={onCancel}
          />
        </Col>
      </Row>
    </Container>
  );
}
Example #15
Source File: index.js    From HexactaLabs-NetCore_React-Final with Apache License 2.0 6 votes vote down vote up
Update = ({
  initialValues,
  update: onSubmit,
  goBack: onCancel,
  productTypeOptions,
  providerOptions
}) => {
  return (
    <Container fluid>
      <Row>
        <Col>
            <div className="block-header">
                <h1>Edición</h1>
            </div>
        </Col>
      </Row>
      <Row>
        <Col>
          <Form
            initialValues={initialValues}
            productTypeOptions={productTypeOptions}
            providerOptions={providerOptions}
            onSubmit={onSubmit}
            handleCancel={onCancel}
          />
        </Col>
      </Row>
    </Container>
  );
}
Example #16
Source File: index.js    From HexactaLabs-NetCore_React-Initial with Apache License 2.0 6 votes vote down vote up
Create = ({ create: onSubmit, goBack: onCancel }) => {
  return (
    <Container fluid>
      <Row>
          <div className="block-header">
            <h2>Nuevo Proveedor</h2>
            </div>
      </Row>
      <Row>
        <Col>
          <Form onSubmit={onSubmit} handleCancel={onCancel} />
        </Col>
      </Row>
    </Container>
  );
}
Example #17
Source File: index.js    From HexactaLabs-NetCore_React-Level1 with Apache License 2.0 6 votes vote down vote up
export function update(producttype) {
  return function(dispatch) {
    dispatch(setLoading(true));
    return api
      .put(`/producttype/${producttype.id}`, producttype)
      .then(() => {
        toast.success("El tipo de producto se editó con éxito");
        dispatch(success(producttype));
        dispatch(setLoading(false));
        return dispatch(goBack());
      })
      .catch(error => {
        apiErrorToast(error);
        return dispatch(setLoading(false));
      });
  };
}
Example #18
Source File: index.js    From HexactaLabs-NetCore_React-Final with Apache License 2.0 5 votes vote down vote up
ProductRemovePage.propTypes = {
  remove: PropTypes.func.isRequired,
  goBack: PropTypes.func.isRequired,
  match: PropTypes.object.isRequired
};
Example #19
Source File: index.js    From HexactaLabs-NetCore_React-Level1 with Apache License 2.0 5 votes vote down vote up
mapDispatchToProps = {
  create,
  goBack,
}
Example #20
Source File: index.js    From HexactaLabs-NetCore_React-Level2 with Apache License 2.0 5 votes vote down vote up
Update.propTypes = {
  initialValues: PropTypes.object.isRequired,
  update: PropTypes.func.isRequired,
  goBack: PropTypes.func.isRequired
};
Example #21
Source File: index.js    From HexactaLabs-NetCore_React-Level1 with Apache License 2.0 5 votes vote down vote up
mapDispatchToProps = { remove, goBack }
Example #22
Source File: index.js    From HexactaLabs-NetCore_React-Initial with Apache License 2.0 5 votes vote down vote up
mapDispatchToProps = { remove, goBack }
Example #23
Source File: index.js    From HexactaLabs-NetCore_React-Final with Apache License 2.0 5 votes vote down vote up
mapDispatchToProps = { remove, goBack }
Example #24
Source File: index.js    From HexactaLabs-NetCore_React-Initial with Apache License 2.0 5 votes vote down vote up
StoreRemovePage.propTypes = {
  remove: PropTypes.func.isRequired,
  goBack: PropTypes.func.isRequired,
  match: PropTypes.object.isRequired
};
Example #25
Source File: index.js    From HexactaLabs-NetCore_React-Level2 with Apache License 2.0 5 votes vote down vote up
mapDispatchToProps = {
  create,
  goBack
}
Example #26
Source File: LogoutPage.js    From HexactaLabs-NetCore_React-Initial with Apache License 2.0 5 votes vote down vote up
LogoutPage = ({ logout, goBack }) => (
  <Logout confirm={logout} cancel={goBack} />
)
Example #27
Source File: index.js    From HexactaLabs-NetCore_React-Final with Apache License 2.0 5 votes vote down vote up
Create = ({
  create: onSubmit,
  goBack: onCancel,
  productTypeOptions,
  providerOptions,
  initialValues
}) => {
  return (
    <Container fluid>
      <Row>
        <h2>Nuevo Producto</h2>
      </Row>
      {!productTypeOptions.length ? (
        <Row>
          <Col>
            <Alert color="warning">
              No existen categorías. Click&nbsp;
              <Link to="../product-type/create">aquí</Link> para cargar nuevas
              categorías.
            </Alert>
          </Col>
        </Row>
      ) : null}
      {!providerOptions.length ? (
        <Row>
          <Col>
            <Alert color="warning">
              No existen proveedores. Click&nbsp;
              <Link to="../provider/create">aquí</Link> para crear uno nuevo.
            </Alert>
          </Col>
        </Row>
      ) : null}
      <Row>
        <Col>
          <Form
            initialValues={initialValues}
            productTypeOptions={productTypeOptions}
            providerOptions={providerOptions}
            onSubmit={onSubmit}
            handleCancel={onCancel}
          />
        </Col>
      </Row>
    </Container>
  );
}