frontend api refactoring
This commit is contained in:
@@ -1,24 +1,14 @@
|
|||||||
import fetch from 'isomorphic-fetch';
|
import fetch from 'isomorphic-fetch';
|
||||||
import {BASE_URL} from '../config/config';
|
import {BASE_URL} from '../config/config';
|
||||||
|
|
||||||
export const getAllIntents = (id)=>{
|
|
||||||
let url = `http://${BASE_URL}/intents/${id}`
|
|
||||||
return fetch(url, {method: 'GET'});
|
|
||||||
}
|
|
||||||
|
|
||||||
export const getSkill = (id)=>{
|
export const getSkill = (id)=>{
|
||||||
let url = `http://${BASE_URL}/getSkill/${id}`
|
let url = `http://${BASE_URL}/skill/${id}`
|
||||||
return fetch(url, {method: 'GET'});
|
|
||||||
}
|
|
||||||
|
|
||||||
export const deleteSkill = (id)=>{
|
|
||||||
let url = `http://${BASE_URL}/deleteSkill/${id}`
|
|
||||||
return fetch(url, {method: 'GET'});
|
return fetch(url, {method: 'GET'});
|
||||||
}
|
}
|
||||||
|
|
||||||
export const updateSkill = (skill)=>{
|
export const updateSkill = (skill)=>{
|
||||||
let id = (skill._id) ? skill._id : -1;
|
let id = (skill._id) ? skill._id : -1;
|
||||||
let url = `http://${BASE_URL}/updateSkill/${id}`
|
let url = `http://${BASE_URL}/skill/${id}`
|
||||||
return fetch(url, {
|
return fetch(url, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
Reference in New Issue
Block a user