Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created February 7, 2020 06:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/306d292267e248ae597176609e3be399 to your computer and use it in GitHub Desktop.
Save parzibyte/306d292267e248ae597176609e3be399 to your computer and use it in GitHub Desktop.
import { HttpClient } from './HttpClient';
export const ClientesService = {
async obtenerClientes() {
return HttpClient.get('/clientes')
.then(clientes => clientes);
},
async agregarCliente(cliente) {
return HttpClient.post('/cliente', cliente)
.then(registrado => registrado);
},
async actualizarCliente(cliente) {
return HttpClient.put('/cliente', cliente)
.then(registrado => registrado);
},
async eliminarCliente(id) {
return HttpClient.delete(`/cliente/${id.toString()}`)
.then(eliminado => eliminado);
},
};
export default { ClientesService };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment