mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-24 02:06:19 +01:00
Fixed team websites query.
This commit is contained in:
parent
22aeaf7166
commit
835289a1f8
@ -1,4 +1,3 @@
|
||||
import { Breadcrumbs, Item } from 'react-basics';
|
||||
import { useIntl } from 'react-intl';
|
||||
import Page from 'components/layout/Page';
|
||||
import PageHeader from 'components/layout/PageHeader';
|
||||
@ -11,10 +10,7 @@ export default function ProfileSettings() {
|
||||
|
||||
return (
|
||||
<Page>
|
||||
<PageHeader>
|
||||
<Breadcrumbs>
|
||||
<Item>{formatMessage(labels.profile)}</Item>
|
||||
</Breadcrumbs>
|
||||
<PageHeader title={formatMessage(labels.profile)}>
|
||||
<PasswordChangeButton />
|
||||
</PageHeader>
|
||||
<ProfileDetails />
|
||||
|
@ -10,8 +10,8 @@ export interface TeamWebsiteRequestQuery {
|
||||
}
|
||||
|
||||
export interface TeamWebsiteRequestBody {
|
||||
website_id: string;
|
||||
team_website_id?: string;
|
||||
websiteId: string;
|
||||
teamWebsiteId?: string;
|
||||
}
|
||||
|
||||
export default async (
|
||||
|
@ -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…
Reference in New Issue
Block a user