From b1ec1f0b20ca9c9b4139226d008e83ac11b32687 Mon Sep 17 00:00:00 2001 From: Singh Date: Sun, 29 Oct 2023 18:53:30 +0100 Subject: [PATCH] fixed build errors, some using any(improve any in whole project) --- app/create-project/page.tsx | 1 + app/page.tsx | 2 ++ app/utils/methods.ts | 2 +- next-auth.d.ts | 5 ++++- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/create-project/page.tsx b/app/create-project/page.tsx index b6b1cdb..4e888c8 100644 --- a/app/create-project/page.tsx +++ b/app/create-project/page.tsx @@ -4,6 +4,7 @@ import User from '@/models/user.model'; import CreateProjectComponent from './CreateProjectComponent'; import { toPlainObject } from '../utils/methods'; import Project, { ProjectDocument } from '@/models/project.model'; +export const dynamic = 'force-dynamic'; const CreateProject = async ({ params, diff --git a/app/page.tsx b/app/page.tsx index cb81959..a762fcb 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -6,6 +6,8 @@ import User from '@/models/user.model'; import Project from '@/models/project.model'; import ProjectDataRow from './components/ProjectDataRow'; +export const revalidate = 60; + const ProjectName = ({ projectName }: { projectName: string }) => (

{projectName}

); diff --git a/app/utils/methods.ts b/app/utils/methods.ts index 3409433..1897295 100644 --- a/app/utils/methods.ts +++ b/app/utils/methods.ts @@ -140,7 +140,7 @@ const getTimeRangeData = async ( startDate: any, isAdmin: any ) => { - let pipeline; + let pipeline: any[]; if (isAdmin) { pipeline = [ matchProject(projectId), diff --git a/next-auth.d.ts b/next-auth.d.ts index f53eeb2..dc287d8 100644 --- a/next-auth.d.ts +++ b/next-auth.d.ts @@ -1,6 +1,6 @@ // Ref: https://next-auth.js.org/getting-started/typescript#module-augmentation -import { DefaultSession, DefaultUser } from 'next-auth'; +import { DefaultSession, DefaultUser, Profile } from 'next-auth'; import { JWT, DefaultJWT } from 'next-auth/jwt'; declare module 'next-auth' { @@ -16,6 +16,9 @@ declare module 'next-auth' { interface User extends DefaultUser { role: string; } + interface Profile { + email_verified?: boolean; + } } declare module 'next-auth/jwt' {