|
|
|
|
@ -4,6 +4,8 @@ import { |
|
|
|
|
useState, |
|
|
|
|
} from 'react' |
|
|
|
|
|
|
|
|
|
import { client } from 'config/clients' |
|
|
|
|
|
|
|
|
|
import map from 'lodash/map' |
|
|
|
|
|
|
|
|
|
import { |
|
|
|
|
@ -42,19 +44,21 @@ export const useTournamentPopup = () => { |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
(async () => { |
|
|
|
|
Promise.all([ |
|
|
|
|
getTournaments(1, tournamentsId).then(convertData), |
|
|
|
|
getTeams(1, teamsId).then(convertData), |
|
|
|
|
]) |
|
|
|
|
.then((data) => { |
|
|
|
|
// @ts-expect-error
|
|
|
|
|
setTournaments(data[0]) |
|
|
|
|
// @ts-expect-error
|
|
|
|
|
setTeams(data[1]) |
|
|
|
|
setFetching(false) |
|
|
|
|
}) |
|
|
|
|
})() |
|
|
|
|
if (client.name === 'facr') { |
|
|
|
|
(async () => { |
|
|
|
|
Promise.all([ |
|
|
|
|
getTournaments(1, tournamentsId).then(convertData), |
|
|
|
|
getTeams(1, teamsId).then(convertData), |
|
|
|
|
]) |
|
|
|
|
.then((data) => { |
|
|
|
|
// @ts-expect-error
|
|
|
|
|
setTournaments(data[0]) |
|
|
|
|
// @ts-expect-error
|
|
|
|
|
setTeams(data[1]) |
|
|
|
|
setFetching(false) |
|
|
|
|
}) |
|
|
|
|
})() |
|
|
|
|
} |
|
|
|
|
}, [convertData]) |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
|