Skip to content

Commit

Permalink
Fix data loading after axios request (#180)
Browse files Browse the repository at this point in the history
* fix fetch calls

* fix data loading
  • Loading branch information
albarbaro authored Oct 5, 2023
1 parent 28970ce commit 0816191
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions frontend/src/app/CiFailures/CiFailures.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ let CiFailures = () => {

useEffect(() => {
if (state.teams.Team != '') {
getFailures(state.teams.Team, rangeDateTime).then((data: any) => {
setFailures(data)
getFailures(state.teams.Team, rangeDateTime).then((res: any) => {
setFailures(res.data)
});
}
}, [rangeDateTime]);
Expand All @@ -78,13 +78,13 @@ let CiFailures = () => {
const start = params.get('start');
const end = params.get('end');

getFailures(state.teams.Team, rangeDateTime).then((data: any) => {
if (data.length < 1 && (team == state.teams.Team || team == null)) {
getFailures(state.teams.Team, rangeDateTime).then((res: any) => {
if (res.data.length < 1 && (team == state.teams.Team || team == null)) {
setLoadingState(false)
history.push('/home/rhtapbugs-impact?team=' + currentTeam);
}

if (data.length > 0 && (team == state.teams.Team || team == null)) {
if (res.data.length > 0 && (team == state.teams.Team || team == null)) {
if (start == null || end == null) {
// first click on page or team
const start_date = formatDate(rangeDateTime[0]);
Expand Down

0 comments on commit 0816191

Please sign in to comment.