feat: 拆分"再来一轮"为 Top N 决赛和换一批餐厅两个选项

This commit is contained in:
2026-02-24 19:34:35 +08:00
parent 5d297684fc
commit cb9f4a3d0f
4 changed files with 102 additions and 16 deletions
+10
View File
@@ -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>
);