Skip to content

Commit

Permalink
reconfigure fetching systems to look for a status instead of ok.
Browse files Browse the repository at this point in the history
  • Loading branch information
ATNoblis committed Aug 29, 2024
1 parent 68ce9f5 commit a0b6d4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/axiosConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ const axiosInstance: AxiosInstance = axios.create({
},
// withCredentials: true,
})

if (process.env.NODE_ENV === 'development') {
axiosInstance.defaults.headers.common['Authorization'] =
`Bearer ${import.meta.env.VITE_AUTH_TOKEN3 || ''}`
}
export default axiosInstance
2 changes: 1 addition & 1 deletion src/views/FismaTable/FismaTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export default function FismaTable() {
const fetchFismaSystems = async () => {
try {
const fismaSystems = await axiosInstance.get('/fismasystems')
if (!fismaSystems.statusText) {
if (fismaSystems.status !== 200) {
throw new Error('Failed to fetch data')
}
setFismaSystems(fismaSystems.data)
Expand Down

0 comments on commit a0b6d4c

Please sign in to comment.