feat: 拆分"再来一轮"为 Top N 决赛和换一批餐厅两个选项
This commit is contained in:
@@ -34,6 +34,15 @@ export default function RoomPage() {
|
||||
await mutate();
|
||||
}, [roomId, mutate]);
|
||||
|
||||
const handleNarrow = useCallback(async (restaurantIds: string[]) => {
|
||||
await fetch(`/api/room/${roomId}/reset`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ restaurantIds }),
|
||||
});
|
||||
await mutate();
|
||||
}, [roomId, mutate]);
|
||||
|
||||
const initialIndex = swipeCounts[userId] ?? 0;
|
||||
const ready = joined && userId && restaurants.length > 0;
|
||||
|
||||
@@ -62,6 +71,7 @@ export default function RoomPage() {
|
||||
swipeCounts={swipeCounts}
|
||||
userCount={userCount}
|
||||
onReset={handleReset}
|
||||
onNarrow={handleNarrow}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user