Add user cards to /q/ready page

This commit is contained in:
Kalle
2026-08-09 15:03:40 +03:00
parent d88c027169
commit a7a72074bc
2 changed files with 6 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
import { redirect } from "react-router";
import { requireUser } from "~/features/auth/core/user.server";
import * as SQGroupRepository from "~/features/sendouq/SQGroupRepository.server";
import * as UserCardRepository from "~/features/user-card/UserCardRepository.server";
import { dateToDatabaseTimestamp } from "~/utils/dates";
import { SENDOUQ_LOOKING_PAGE } from "~/utils/urls";
import * as ReadyCheck from "../core/ready-check.server";
@@ -33,6 +34,9 @@ export const loader = async () => {
);
return {
...(await UserCardRepository.findAllByUserIdsCached({
userIds: ownGroup!.members.map((member) => member.id),
})),
group: ownGroup!,
expiresAt: dateToDatabaseTimestamp(ReadyCheck.expiresAt(readyCheck)),
readyUserIds: readyCheck.members

View File

@@ -77,11 +77,13 @@ describe("SendouQ ready check page", () => {
"group",
"readyUserIds",
"theirGroup",
"userCards",
]);
const shownUserIds = [
...data.group.members.map((member) => member.id),
...data.readyUserIds,
...data.userCards.keys(),
];
for (const member of theirMembers) {
expect(shownUserIds).not.toContain(member.id);