mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 15:17:23 +01:00
Fixed team websites query.
This commit is contained in:
parent
22aeaf7166
commit
835289a1f8
3 changed files with 12 additions and 12 deletions
|
|
@ -1,8 +1,7 @@
|
|||
import { Prisma, Team } from '@prisma/client';
|
||||
import { Prisma, Team, TeamWebsite } from '@prisma/client';
|
||||
import prisma from 'lib/prisma';
|
||||
import { uuid } from 'lib/crypto';
|
||||
import { ROLES } from 'lib/constants';
|
||||
import { Website } from 'lib/types';
|
||||
|
||||
export async function getTeam(where: Prisma.TeamWhereInput): Promise<Team> {
|
||||
return prisma.client.team.findFirst({
|
||||
|
|
@ -16,14 +15,19 @@ export async function getTeams(where: Prisma.TeamWhereInput): Promise<Team[]> {
|
|||
});
|
||||
}
|
||||
|
||||
export async function getTeamWebsites(teamId: string): Promise<Website[]> {
|
||||
return prisma.client.website.findMany({
|
||||
export async function getTeamWebsites(teamId: string): Promise<TeamWebsite[]> {
|
||||
return prisma.client.teamWebsite.findMany({
|
||||
where: {
|
||||
teamId,
|
||||
},
|
||||
include: {
|
||||
team: true,
|
||||
},
|
||||
orderBy: [
|
||||
{
|
||||
name: 'asc',
|
||||
team: {
|
||||
name: 'asc',
|
||||
},
|
||||
},
|
||||
],
|
||||
} as any);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue