Added owner column to teams table.

This commit is contained in:
Mike Cao 2023-02-02 02:54:43 -08:00
parent e5b57f63cd
commit 22aeaf7166
3 changed files with 4 additions and 3 deletions

1
assets/add-user.svg Normal file
View File

@ -0,0 +1 @@
<svg id="Layer_2" height="512" viewBox="0 0 30 30" width="512" xmlns="http://www.w3.org/2000/svg" data-name="Layer 2"><g fill="rgb(0,0,0)"><path d="m15 14a5.5 5.5 0 1 1 5.5-5.5 5.51 5.51 0 0 1 -5.5 5.5zm0-9a3.5 3.5 0 1 0 3.5 3.5 3.5 3.5 0 0 0 -3.5-3.5z"/><path d="m7.5 24.5a1 1 0 0 1 -1-1 8.5 8.5 0 0 1 13.6-6.8 1 1 0 1 1 -1.2 1.6 6.44 6.44 0 0 0 -3.9-1.3 6.51 6.51 0 0 0 -6.5 6.5 1 1 0 0 1 -1 1z"/><path d="m23 27a1 1 0 0 1 -1-1v-6a1 1 0 0 1 2 0v6a1 1 0 0 1 -1 1z"/><path d="m26 24h-6a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2z"/></g></svg>

After

Width:  |  Height:  |  Size: 529 B

View File

@ -42,7 +42,7 @@ export default function TeamsTable({ data = [] }) {
const rowData = {
...row,
owner: row.teamUsers.find(({ role }) => role === ROLES.teamOwner)?.user?.username,
owner: row.teamUser.find(({ role }) => role === ROLES.teamOwner)?.user?.username,
action: (
<Flexbox flex={1} justifyContent="end">
<Link href={`/settings/teams/${id}`}>

View File

@ -49,14 +49,14 @@ export async function getUsers(): Promise<User[]> {
export async function getUserTeams(userId: string): Promise<Team[]> {
return prisma.client.team.findMany({
where: {
teamUsers: {
teamUser: {
some: {
userId,
},
},
},
include: {
teamUsers: {
teamUser: {
include: {
user: true,
},