mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 07:37:11 +01:00
Feat/um 197 hook up teams (#1825)
* Link up teams UI. * Fix auth order. * PR touchups.
This commit is contained in:
parent
f908476e71
commit
8a9532f213
17 changed files with 500 additions and 111 deletions
|
|
@ -18,26 +18,8 @@ export async function getTeams(where: Prisma.TeamWhereInput): Promise<Team[]> {
|
|||
});
|
||||
}
|
||||
|
||||
export async function getTeamWebsites(teamId: string): Promise<TeamWebsite[]> {
|
||||
return prisma.client.teamWebsite.findMany({
|
||||
where: {
|
||||
teamId,
|
||||
},
|
||||
include: {
|
||||
team: true,
|
||||
},
|
||||
orderBy: [
|
||||
{
|
||||
team: {
|
||||
name: 'asc',
|
||||
},
|
||||
},
|
||||
],
|
||||
} as any);
|
||||
}
|
||||
|
||||
export async function createTeam(data: Prisma.TeamCreateInput): Promise<Team> {
|
||||
const { id, userId } = data;
|
||||
export async function createTeam(data: Prisma.TeamCreateInput, userId: string): Promise<Team> {
|
||||
const { id } = data;
|
||||
|
||||
return prisma.transaction([
|
||||
prisma.client.team.create({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue