Fixed types.

This commit is contained in:
Mike Cao 2023-12-03 23:02:28 -08:00
parent 66d7a815fc
commit e718b22599
2 changed files with 4 additions and 4 deletions

View File

@ -42,7 +42,7 @@ export default async (
if (req.method === 'GET') { if (req.method === 'GET') {
if (await canViewAllWebsites(req.auth)) { if (await canViewAllWebsites(req.auth)) {
const websites = getWebsites(req.query, { const websites = await getWebsites(req.query, {
include: { include: {
teamWebsite: { teamWebsite: {
include: { include: {

View File

@ -21,7 +21,7 @@ export async function getWebsiteByShareId(shareId: string) {
export async function getWebsites( export async function getWebsites(
filters: WebsiteSearchFilter, filters: WebsiteSearchFilter,
options?: { include?: Prisma.WebsiteInclude }, options?: { include?: Prisma.WebsiteInclude },
): Promise<FilterResult<Website[]>> { ): Promise<FilterResult<Website>> {
const { userId, teamId, includeTeams, onlyTeams, query } = filters; const { userId, teamId, includeTeams, onlyTeams, query } = filters;
const mode = prisma.getSearchMode(); const mode = prisma.getSearchMode();
@ -105,7 +105,7 @@ export async function getWebsites(
export async function getWebsitesByUserId( export async function getWebsitesByUserId(
userId: string, userId: string,
filters?: WebsiteSearchFilter, filters?: WebsiteSearchFilter,
): Promise<FilterResult<Website[]>> { ): Promise<FilterResult<Website>> {
return getWebsites( return getWebsites(
{ userId, ...filters }, { userId, ...filters },
{ {
@ -133,7 +133,7 @@ export async function getWebsitesByUserId(
export async function getWebsitesByTeamId( export async function getWebsitesByTeamId(
teamId: string, teamId: string,
filters?: WebsiteSearchFilter, filters?: WebsiteSearchFilter,
): Promise<FilterResult<Website[]>> { ): Promise<FilterResult<Website>> {
return getWebsites( return getWebsites(
{ {
teamId, teamId,