From 9c396976bb42a9d41407358ce1a1d37242230f21 Mon Sep 17 00:00:00 2001 From: gabrhr <73925454+gabrhr@users.noreply.github.com> Date: Fri, 27 May 2022 12:50:13 -0500 Subject: Add redux, dispatch and etiquetas MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - estetica de etiquetas (ok) - add message, pedido Reducer - add dispatch en Componentes con connect - add api reducer que obtienen el JSON todo ok #TODO - FIX logica de añadiir - FIX axios y dispatch fuera de un componente --- front/odiparpack/app/api/pedido.js | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 front/odiparpack/app/api/pedido.js (limited to 'front/odiparpack/app/api/pedido.js') diff --git a/front/odiparpack/app/api/pedido.js b/front/odiparpack/app/api/pedido.js new file mode 100644 index 0000000..7cfb3f7 --- /dev/null +++ b/front/odiparpack/app/api/pedido.js @@ -0,0 +1,6 @@ +import { apiPost, apiGet, apiDelete, apiPut } from "odi-utils/api"; + +//GET APIS +export const getPedidosAPI = () => { + return apiGet('ayuda/') +} \ No newline at end of file -- cgit v1.2.3 From 32fb17de8f78317b165b6f269a8bab2d4e852d0d Mon Sep 17 00:00:00 2001 From: gabrhr <73925454+gabrhr@users.noreply.github.com> Date: Mon, 30 May 2022 20:08:04 -0500 Subject: Fix axios and add new MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - FIX logica de añadiir (ok) - FIX axios y dispatch fuera de un componente (ok) - Cambiar las notificaciones --- front/odiparpack/app/api/pedido.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'front/odiparpack/app/api/pedido.js') diff --git a/front/odiparpack/app/api/pedido.js b/front/odiparpack/app/api/pedido.js index 7cfb3f7..63d6e2e 100644 --- a/front/odiparpack/app/api/pedido.js +++ b/front/odiparpack/app/api/pedido.js @@ -1,6 +1,18 @@ -import { apiPost, apiGet, apiDelete, apiPut } from "odi-utils/api"; +import axios from 'axios'; +import { apiGet } from '../utils/odipar/api'; //GET APIS -export const getPedidosAPI = () => { - return apiGet('ayuda/') +export const getPedidosAPI = async () => { + return await apiGet(`ayuda/`) +} + +export function getAPi(){ + axios.get( + `http://localhost:8083/ayuda/`, //TODO: check currentTimeStamp + { + headers: { + 'Content-type': 'application/json', + }, + } + ) } \ No newline at end of file -- cgit v1.2.3