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 (await canViewAllWebsites(req.auth)) {
const websites = getWebsites(req.query, {
const websites = await getWebsites(req.query, {
include: {
teamWebsite: {
include: {

View File

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