Skip to content

Commit 63cdf4a

Browse files
committed
fix: call 함수 index 타입 지정
1 parent 51ea9c4 commit 63cdf4a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/WaitingList/ListTable.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ export default function ListTable({waiting ,setTemp}:{waiting:waitings[]|undefin
6363
};
6464

6565
//대기목록 MUI 안에 있는 호출 버튼
66-
const Call =()=>{
66+
const Call =(index: number)=>{
67+
if(waiting !== undefined) {
6768
axios.post('http://15.164.28.246:8000/api/v1/stores/notifications/',{
6869
waiting_id: waiting[index].waiting_id
6970
},
@@ -76,7 +77,7 @@ export default function ListTable({waiting ,setTemp}:{waiting:waitings[]|undefin
7677
.catch((error) => {
7778
console.log('호출 실패');
7879
});
79-
}
80+
}}
8081

8182
//대기목록 MUI 안에 있는 입장완료 버튼
8283
const Start = (index: number) => {
@@ -164,7 +165,7 @@ export default function ListTable({waiting ,setTemp}:{waiting:waitings[]|undefin
164165
</TableCell>
165166
);
166167
})}
167-
<TableCell onClick={() => Call()} align="center"><IconButton><NotificationsActiveIcon color="warning"/></IconButton></TableCell>
168+
<TableCell onClick={() => Call(index)} align="center"><IconButton><NotificationsActiveIcon color="warning"/></IconButton></TableCell>
168169
<TableCell onClick={() => Start(index)} align="center"><IconButton><CheckCircleIcon color="success"/></IconButton></TableCell>
169170
<TableCell onClick={() => waitingCancel(index)} align="center"><IconButton><CancelIcon color="error"/></IconButton></TableCell>
170171
</TableRow>

0 commit comments

Comments
 (0)