Skip to content

Commit a4a6ca7

Browse files
committed
fix: api request
1 parent 3e4f4b7 commit a4a6ca7

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/views/vote/api/postVote.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import instance from "@/shared/lib/axios";
22

3-
export const postVote = async (teamName: string, team_id: number) => {
3+
export const postVote = async (star: number, team_id: number) => {
44
try {
55
return await instance.post("vote", {
66
select: true,
7-
teamName,
7+
star,
88
team_id,
99
});
1010
} catch (error) {

src/views/vote/ui/VoteView/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function VoteView() {
1717

1818
const handleVote = async () => {
1919
if (data?.team_id && data.teamName) {
20-
const res = await postVote(data?.teamName, data?.team_id);
20+
const res = await postVote(score.filter(v => v).length, data?.team_id);
2121
if (res.status === 200) {
2222
toast.success("투표되었습니다");
2323
setIsSuccess(true);

0 commit comments

Comments
 (0)