tag.name === 'skills_front')}
+ dataTags={tagsArr && tagsArr.flat().filter((tag) => tag.name === 'skills_front')}
img={front}
header="Фронтенд"
/>
diff --git a/src/components/Select/TagSelect.js b/src/components/Select/TagSelect.js
index 85fd2a94..a78075b4 100644
--- a/src/components/Select/TagSelect.js
+++ b/src/components/Select/TagSelect.js
@@ -15,7 +15,7 @@ const TagSelect = () => {
const handleSubmit = () => {
const filterItemsId = itemsArr.map((item) => item.id).join();
- fetchItemsForId(`https://guild.craft-group.xyz/api/profile?skills=`, filterItemsId).then((el) =>
+ fetchItemsForId(`${process.env.REACT_APP_API_URL}/api/profile?skills=`, filterItemsId).then((el) =>
dispatch(filteredCandidates(el))
);
diff --git a/src/server/server.js b/src/server/server.js
index 05f019ef..8effa413 100644
--- a/src/server/server.js
+++ b/src/server/server.js
@@ -2,7 +2,9 @@ export const fetchProfile = async (link, index) => {
try {
const response = await fetch(`${link}${index}`, {
headers: {
- 'Authorization': `Bearer ${localStorage.getItem('auth_token')}`
+ 'Access-Control-Request-Headers': 'authorization',
+ 'Authorization': `Bearer ${localStorage.getItem('auth_token')}`,
+ 'Origin': `${process.env.REACT_APP_BASE_URL}`,
}
})
let data = await response.json()
@@ -15,7 +17,9 @@ export const fetchSkills = async (link) => {
try {
const response = await fetch(link, {
headers: {
- 'Authorization': `Bearer ${localStorage.getItem('auth_token')}`
+ 'Access-Control-Request-Headers': 'authorization',
+ 'Authorization': `Bearer ${localStorage.getItem('auth_token')}`,
+ 'Origin': `${process.env.REACT_APP_BASE_URL}`,
}
})
let data = await response.json()
@@ -25,10 +29,13 @@ export const fetchSkills = async (link) => {
}
export const fetchItemsForId = async (link, id) => {
+ console.log(`Bearer ${localStorage.getItem('auth_token')}`);
try {
const response = await fetch(`${link}${id}`, {
headers: {
- 'Authorization': `Bearer ${localStorage.getItem('auth_token')}`
+ // 'Access-Control-Request-Headers': 'authorization',
+ 'Authorization': `Bearer ${localStorage.getItem('auth_token')}`,
+ 'Origin': `${process.env.REACT_APP_BASE_URL}`,
}
})
let data = await response.json()
@@ -42,7 +49,9 @@ export const fetchForm = async (link, info) => {
const response = await fetch(link, {
method: 'POST',
headers: {
+ 'Access-Control-Request-Headers': 'authorization',
'Authorization': `Bearer ${localStorage.getItem('auth_token')}`,
+ 'Origin': `${process.env.REACT_APP_BASE_URL}`,
'Content-Type': 'multipart/form-data'
},
body: info