Skip to content

Commit

Permalink
- Correct logic if reponse is null
Browse files Browse the repository at this point in the history
  • Loading branch information
elipe17 committed Nov 21, 2024
1 parent a0bade8 commit 8700e5e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tdrs-frontend/src/actions/reports.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,12 @@ export const SET_FILE_TYPE = 'SET_FILE_TYPE'

export const setStt = (stt) => async (dispatch) => {
const URL = `${process.env.REACT_APP_BACKEND_URL}/stts/${stt}`
const data = await axiosInstance.get(URL, {
const response = await axiosInstance.get(URL, {
withCredentials: true,
})
const newUploadSections =
typeof data !== 'undefined' ? Object.keys(data.filenames) : []
const data =
typeof response !== 'undefined' ? response.data : { filenames: [] }
const newUploadSections = Object.keys(data.filenames)
dispatch({ type: SET_SELECTED_STT, payload: { stt, newUploadSections } })
}
export const setYear = (year) => (dispatch) => {
Expand Down

0 comments on commit 8700e5e

Please sign in to comment.