From fab7d63333b86b9fe0f1c52d2c642b52bbf506c0 Mon Sep 17 00:00:00 2001 From: gabrhr <73925454+gabrhr@users.noreply.github.com> Date: Mon, 6 Jun 2022 11:35:56 -0500 Subject: Add CRUD Camiones MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - están ok funcionando: listar, insertar, editar, eliminar #TODO - añadir todos los puntos - Mejorar el path del punto con funcion - añadir tiempos segun distancia - estetica al final (camion, colores, etc) - Arreglar combos - Añadir los reducer de pedidos, rutas, almacen Camiones CRUD - ver codigo de camion corelativo - añadir Ciudad origen --- front/odiparpack/app/api/camion.js | 17 ++++++++++++++++- front/odiparpack/app/api/pedido.js | 2 +- front/odiparpack/app/api/tipoCamion.js | 10 ++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 front/odiparpack/app/api/tipoCamion.js (limited to 'front/odiparpack/app/api') diff --git a/front/odiparpack/app/api/camion.js b/front/odiparpack/app/api/camion.js index 8229bbf..b368522 100644 --- a/front/odiparpack/app/api/camion.js +++ b/front/odiparpack/app/api/camion.js @@ -1,6 +1,21 @@ -import { apiGet } from '../utils/odipar/api'; +import { apiDelete, apiGet, apiPost, apiPut } from '../utils/odipar/api'; //GET APIS export const getCamionAPI = async () => { return await apiGet(`camion/`) } + +//POST APIS +export const insertarCamionAPI = async (data) => { + return await apiPost(`camion/`, data) +} + +//PUT APIS +export const editarCamionAPI = async (data) => { + return await apiPut(`camion/`, data) +} + +//DELETE APIS +export const eliminarCamionAPI = async (id) => { + return await apiDelete(`camion/${id}`) +} diff --git a/front/odiparpack/app/api/pedido.js b/front/odiparpack/app/api/pedido.js index 63d6e2e..0b7e3d1 100644 --- a/front/odiparpack/app/api/pedido.js +++ b/front/odiparpack/app/api/pedido.js @@ -3,7 +3,7 @@ import { apiGet } from '../utils/odipar/api'; //GET APIS export const getPedidosAPI = async () => { - return await apiGet(`ayuda/`) + return await apiGet(`camion/`) } export function getAPi(){ diff --git a/front/odiparpack/app/api/tipoCamion.js b/front/odiparpack/app/api/tipoCamion.js new file mode 100644 index 0000000..d932d10 --- /dev/null +++ b/front/odiparpack/app/api/tipoCamion.js @@ -0,0 +1,10 @@ +import { apiGet } from '../utils/odipar/api'; + +//GET APIS +export const getTiposCamionAPI = async () => { + return await apiGet(`tipoCamion/`) +} + +export const getTipoCamionXNombreAPI = async (nombre) => { + return await apiGet(`tipoCamion/nombre=${nombre}`) +} \ No newline at end of file -- cgit v1.2.3