diff options
| author | Dayana31 <[email protected]> | 2022-06-01 16:43:23 -0500 |
|---|---|---|
| committer | Dayana31 <[email protected]> | 2022-06-01 16:43:23 -0500 |
| commit | ec0c33156713e51c64f2a9de4f932cd5507c654b (patch) | |
| tree | cc46421686a49bbc0a0c343e460c13a21af1015d /front/odiparpack/app/actions | |
| parent | 6971201caffc2fccee5bfb12e88e5510c85eeb49 (diff) | |
| parent | e9cb09907f8dbc9a4a64549a3ea4d1d8313e7c25 (diff) | |
| download | DP1_project-ec0c33156713e51c64f2a9de4f932cd5507c654b.tar.gz DP1_project-ec0c33156713e51c64f2a9de4f932cd5507c654b.tar.bz2 DP1_project-ec0c33156713e51c64f2a9de4f932cd5507c654b.zip | |
Merge branch 'develop' into dayana
Diffstat (limited to 'front/odiparpack/app/actions')
| -rw-r--r-- | front/odiparpack/app/actions/actionTypes.js | 9 | ||||
| -rw-r--r-- | front/odiparpack/app/actions/almacen.js | 19 | ||||
| -rw-r--r-- | front/odiparpack/app/actions/message.js | 17 | ||||
| -rw-r--r-- | front/odiparpack/app/actions/pedido.js | 19 |
4 files changed, 64 insertions, 0 deletions
diff --git a/front/odiparpack/app/actions/actionTypes.js b/front/odiparpack/app/actions/actionTypes.js index 08986f2..8fd305f 100644 --- a/front/odiparpack/app/actions/actionTypes.js +++ b/front/odiparpack/app/actions/actionTypes.js @@ -82,3 +82,12 @@ export const DELETE_EVENT = 'DELETE_EVENT'; // Notification Form export const CLOSE_NOTIF = 'CLOSE_NOTIF'; + + +//Odi Message +export const CLOSE_MESSAGE = 'CLOSE_MESSAGE'; +export const OPEN_MESSAGE = 'OPEN_MESSAGE'; +//Odi Pedido +export const LISTA_PEDIDO = 'LISTA_PEDIDO'; +//Odi Almacen +export const LISTA_ALMACEN = 'LISTA_ALMACEN';
\ No newline at end of file diff --git a/front/odiparpack/app/actions/almacen.js b/front/odiparpack/app/actions/almacen.js new file mode 100644 index 0000000..b5694cd --- /dev/null +++ b/front/odiparpack/app/actions/almacen.js @@ -0,0 +1,19 @@ +import { + getAlmacenesAPI +} from 'ba-api/almacen'; +import * as types from './actionTypes' + +export const setAlmacenes = (payload) => ({ + type: types.LISTA_ALMACEN, + payload +}); + +export const getAlmacenes = () => async dispatch => { + try{ + const res = await getAlmacenesAPI(); + dispatch(setAlmacenes({res})) + return res; + }catch(e){ + console.log(e) + } +}
\ No newline at end of file diff --git a/front/odiparpack/app/actions/message.js b/front/odiparpack/app/actions/message.js new file mode 100644 index 0000000..881a41f --- /dev/null +++ b/front/odiparpack/app/actions/message.js @@ -0,0 +1,17 @@ +import * as types from './actionTypes'; +import { partial } from 'odi-utils/constants'; + + +export const closeMessage = () => ({ + type: types.CLOSE_MESSAGE, +}) + +export const setMessage = (type, message) => ({ + type: types.OPEN_MESSAGE, + payload: { + type, message + } +}) + +export const openSuccessMessage = partial(setMessage, 'success'); +export const openErrorMessage = partial(setMessage, 'error');
\ No newline at end of file diff --git a/front/odiparpack/app/actions/pedido.js b/front/odiparpack/app/actions/pedido.js new file mode 100644 index 0000000..8a011f0 --- /dev/null +++ b/front/odiparpack/app/actions/pedido.js @@ -0,0 +1,19 @@ +import { + getPedidosAPI +} from 'ba-api/pedido'; +import * as types from './actionTypes' + +export const setPedidos = (payload) => ({ + type: types.LISTA_PEDIDO, + payload +}); + +export const getPedidos = () => async dispatch => { + try{ + const res = await getPedidosAPI(); + dispatch(setPedidos({res})) + return res; + }catch(e){ + console.log(e) + } +} |
