guild_front/src/server/server.js

41 lines
826 B
JavaScript
Raw Normal View History

2021-07-02 16:02:47 +03:00
export const fetchProfile = async (link, index) => {
2021-07-21 14:40:06 +03:00
try {
const response = await fetch(`${link}${index}`);
let data = await response.json();
2021-06-28 17:57:28 +03:00
2021-07-21 14:40:06 +03:00
return data;
} catch (error) {}
2021-06-28 17:57:28 +03:00
};
2021-06-29 17:58:15 +03:00
export const fetchSkills = async (link) => {
2021-07-21 14:40:06 +03:00
try {
const response = await fetch(link);
let data = await response.json();
2021-06-29 17:58:15 +03:00
2021-07-21 14:40:06 +03:00
return data;
} catch (error) {}
2021-06-29 17:58:15 +03:00
};
2021-07-03 17:37:30 +03:00
export const fetchItemsForId = async (link, id) => {
2021-07-21 14:40:06 +03:00
try {
const response = await fetch(`${link}${id}`);
let data = await response.json();
2021-07-03 17:37:30 +03:00
2021-07-21 14:40:06 +03:00
return data;
} catch (error) {}
2021-07-03 17:37:30 +03:00
};
export const fetchForm = async (link, info) => {
2021-07-21 14:40:06 +03:00
try {
const response = await fetch(link, {
method: 'POST',
headers: {
'Content-Type': 'multipart/form-data',
},
body: info,
});
2021-07-03 17:37:30 +03:00
2021-07-21 14:40:06 +03:00
return response;
} catch (error) {}
2021-07-03 17:37:30 +03:00
};