We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3e4f4b7 commit a4a6ca7Copy full SHA for a4a6ca7
2 files changed
src/views/vote/api/postVote.ts
@@ -1,10 +1,10 @@
1
import instance from "@/shared/lib/axios";
2
3
-export const postVote = async (teamName: string, team_id: number) => {
+export const postVote = async (star: number, team_id: number) => {
4
try {
5
return await instance.post("vote", {
6
select: true,
7
- teamName,
+ star,
8
team_id,
9
});
10
} catch (error) {
src/views/vote/ui/VoteView/index.tsx
@@ -17,7 +17,7 @@ export default function VoteView() {
17
18
const handleVote = async () => {
19
if (data?.team_id && data.teamName) {
20
- const res = await postVote(data?.teamName, data?.team_id);
+ const res = await postVote(score.filter(v => v).length, data?.team_id);
21
if (res.status === 200) {
22
toast.success("투표되었습니다");
23
setIsSuccess(true);
0 commit comments