Skip to content

Commit

Permalink
fix: fetch only team A
Browse files Browse the repository at this point in the history
  • Loading branch information
punchanabu committed Oct 13, 2024
1 parent 5954765 commit 53451a8
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,13 @@ export default function Home() {
useEffect(() => {
const fetchMatchSub = async ({
type_id,
group_id,
}: {
type_id: string;
group_id: string;
}) => {
const res = await getMatchSub({ type_id, group_id });
if (group_id === "A") {
setTeamA(res?.data);
} else {
setTeamB(res?.data);
}
return res?.data;
const resA = await getMatchSub({ type_id, group_id : "A" });
const resB = await getMatchSub({ type_id, group_id : "A" });
setTeamA(resA?.data)
setTeamB(resB?.data);
};

let show = allMatch;
Expand Down Expand Up @@ -139,8 +134,7 @@ export default function Home() {
}

const type_id_temp = filter === "" ? "ALL" : selectorTextMap[filter];
fetchMatchSub({ type_id: type_id_temp, group_id: "A" });
fetchMatchSub({ type_id: type_id_temp, group_id: "B" });
fetchMatchSub({ type_id: type_id_temp });

setShowMatch(show);
}, [mainFilter, filter, allMatch, dateNow]);
Expand Down

0 comments on commit 53451a8

Please sign in to comment.