Skip to content

Commit

Permalink
Create api.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 6, 2024
1 parent 5593cdf commit bbd9af1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions blockchain_integration/PiSure/client/utils/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import axios from 'axios';

const api = axios.create({
baseURL: '/api',
});

export const createPolicy = (data) => api.post('/policies', data);
export const getPolicies = () => api.get('/policies');
export const getPolicy = (id) => api.get(`/policies/${id}`);
export const updatePolicy = (id, data) => api.put(`/policies/${id}`, data);
export const deletePolicy = (id) => api.delete(`/policies/${id}`);

0 comments on commit bbd9af1

Please sign in to comment.