Skip to content

Commit

Permalink
Merge branch '#addFeTestsToGitActions' of https://github.com/ita-soci…
Browse files Browse the repository at this point in the history
…al-projects/Forum into #addFeTestsToGitActions
  • Loading branch information
BelousSofiya committed Nov 2, 2023
2 parents b3b43ae + 8780fd7 commit 8feea0d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
15 changes: 14 additions & 1 deletion FrontEnd/src/components/SearchPage/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,20 @@ export function Search({ isAuthorized }) {
const searchUrl = 'search';
const { mutate } = useSWRConfig();

const fetcher = (url) => axios.get(url).then((res) => res.data);
const fetcher = (url) =>
axios
.get(url)
.then((res) => res.data)
.catch(function (error) {
if (error.response) {
console.log(error.response.data);
} else if (error.request) {
console.log(error.request);
} else {
console.log('Error', error.message);
}
console.log(error.config);
});

async function getRequest(url) {
const data = await fetcher(url);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ const CompanyCard = ({ companyData, isAuthorized }) => {
})
.then((response) => {
return response.data;
})
.catch(function (error) {
if (error.response) {
console.log(error.response.data);
} else if (error.request) {
console.log(error.request);
} else {
console.log('Error', error.message);
}
});
const NewList = [];
for (let item of data.results) {
Expand Down

0 comments on commit 8feea0d

Please sign in to comment.