Fixed team websites query.

This commit is contained in:
Mike Cao 2023-02-02 03:30:09 -08:00
parent 22aeaf7166
commit 835289a1f8
3 changed files with 12 additions and 12 deletions

View File

@ -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 />

View File

@ -10,8 +10,8 @@ export interface TeamWebsiteRequestQuery {
}
export interface TeamWebsiteRequestBody {
website_id: string;
team_website_id?: string;
websiteId: string;
teamWebsiteId?: string;
}
export default async (

View File

@ -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);