mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-24 18:26:20 +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 { useIntl } from 'react-intl';
|
||||||
import Page from 'components/layout/Page';
|
import Page from 'components/layout/Page';
|
||||||
import PageHeader from 'components/layout/PageHeader';
|
import PageHeader from 'components/layout/PageHeader';
|
||||||
@ -11,10 +10,7 @@ export default function ProfileSettings() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Page>
|
<Page>
|
||||||
<PageHeader>
|
<PageHeader title={formatMessage(labels.profile)}>
|
||||||
<Breadcrumbs>
|
|
||||||
<Item>{formatMessage(labels.profile)}</Item>
|
|
||||||
</Breadcrumbs>
|
|
||||||
<PasswordChangeButton />
|
<PasswordChangeButton />
|
||||||
</PageHeader>
|
</PageHeader>
|
||||||
<ProfileDetails />
|
<ProfileDetails />
|
||||||
|
@ -10,8 +10,8 @@ export interface TeamWebsiteRequestQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface TeamWebsiteRequestBody {
|
export interface TeamWebsiteRequestBody {
|
||||||
website_id: string;
|
websiteId: string;
|
||||||
team_website_id?: string;
|
teamWebsiteId?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async (
|
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 prisma from 'lib/prisma';
|
||||||
import { uuid } from 'lib/crypto';
|
import { uuid } from 'lib/crypto';
|
||||||
import { ROLES } from 'lib/constants';
|
import { ROLES } from 'lib/constants';
|
||||||
import { Website } from 'lib/types';
|
|
||||||
|
|
||||||
export async function getTeam(where: Prisma.TeamWhereInput): Promise<Team> {
|
export async function getTeam(where: Prisma.TeamWhereInput): Promise<Team> {
|
||||||
return prisma.client.team.findFirst({
|
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[]> {
|
export async function getTeamWebsites(teamId: string): Promise<TeamWebsite[]> {
|
||||||
return prisma.client.website.findMany({
|
return prisma.client.teamWebsite.findMany({
|
||||||
where: {
|
where: {
|
||||||
teamId,
|
teamId,
|
||||||
},
|
},
|
||||||
|
include: {
|
||||||
|
team: true,
|
||||||
|
},
|
||||||
orderBy: [
|
orderBy: [
|
||||||
{
|
{
|
||||||
name: 'asc',
|
team: {
|
||||||
|
name: 'asc',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
} as any);
|
} as any);
|
||||||
|
Loading…
Reference in New Issue
Block a user