summaryrefslogtreecommitdiffstats
path: root/front/odiparpack/app/actions
diff options
context:
space:
mode:
Diffstat (limited to 'front/odiparpack/app/actions')
-rw-r--r--front/odiparpack/app/actions/actionTypes.js9
-rw-r--r--front/odiparpack/app/actions/almacen.js19
-rw-r--r--front/odiparpack/app/actions/message.js17
-rw-r--r--front/odiparpack/app/actions/pedido.js19
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)
+ }
+}