Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Added owner column to teams table.

Mike Cao22aeaf7166ea
diff --git a/assets/add-user.svg b/assets/add-user.svg
new file mode 100644
index 000000000..9d0544c63
--- /dev/null
+++ b/assets/add-user.svg
@@ -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>
\ No newline at end of file
diff --git a/components/pages/settings/teams/TeamsTable.js b/components/pages/settings/teams/TeamsTable.js
index 3e7dd2cdb..bc26fd479 100644
--- a/components/pages/settings/teams/TeamsTable.js
+++ b/components/pages/settings/teams/TeamsTable.js
@@ -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}`}>
diff --git a/queries/admin/user.ts b/queries/admin/user.ts
index 94109251e..ba6ef186b 100644
--- a/queries/admin/user.ts
+++ b/queries/admin/user.ts
@@ -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,
},