avant codex
This commit is contained in:
8
frontend/src/api/plants.js
Normal file
8
frontend/src/api/plants.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import client from './client';
|
||||
export const plantsApi = {
|
||||
list: (categorie) => client.get('/api/plants', { params: categorie ? { categorie } : {} }).then(r => r.data),
|
||||
get: (id) => client.get(`/api/plants/${id}`).then(r => r.data),
|
||||
create: (p) => client.post('/api/plants', p).then(r => r.data),
|
||||
update: (id, p) => client.put(`/api/plants/${id}`, p).then(r => r.data),
|
||||
delete: (id) => client.delete(`/api/plants/${id}`),
|
||||
};
|
||||
Reference in New Issue
Block a user