Make tournament organization member names show in the chat

This commit is contained in:
Kalle 2024-10-20 13:11:21 +03:00
parent a04d67b367
commit d554ae389c
2 changed files with 7 additions and 2 deletions

View File

@ -556,6 +556,10 @@ function StartedMatchTabs({
return Object.fromEntries(
[
...data.match.players.map((p) => ({ ...p, title: undefined })),
...(tournament.ctx.organization?.members ?? []).map((m) => ({
...m,
title: m.role === "STREAMER" ? "Stream" : "TO",
})),
...tournament.ctx.staff.map((s) => ({
...s,
title: s.role === "STREAMER" ? "Stream" : "TO",
@ -663,7 +667,7 @@ function StartedMatchTabs({
chat={chat}
onMount={onChatMount}
onUnmount={onChatUnmount}
missingUserName="TO"
missingUserName="???"
/>
) : null}
</>

View File

@ -58,7 +58,8 @@ export async function findById(id: number) {
.select([
"TournamentOrganizationMember.userId",
"TournamentOrganizationMember.role",
"User.username",
...COMMON_USER_FIELDS,
userChatNameColor,
])
.whereRef(
"TournamentOrganizationMember.organizationId",