This commit is contained in:
GotPPay
2017-11-30 17:43:24 +01:00
parent 630e812654
commit 4f36fc7738
29 changed files with 2884 additions and 43 deletions

24
web/src/lib/api.js Normal file
View File

@@ -0,0 +1,24 @@
import fetch from 'isomorphic-fetch';
import {BASE_URL} from '../config';
export const getAllIntents = ()=>{
let url = `http://${BASE_URL}/intents`
return fetch(url, {method: 'GET'});
}
export const deleteIntent = id=>{
let url = `http://${BASE_URL}/deleteIntent/${id}`
return fetch(url, {method: 'GET'});
}
export const updateIntent = (id,intent)=>{
let url = `http://${BASE_URL}/updateIntent/${id}`
return fetch(url, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(intent),
});
}