From 7d932fbecd3bd5ad45dc639a251930e5fa08fa63 Mon Sep 17 00:00:00 2001 From: Raditya Harya Date: Tue, 23 Apr 2024 04:41:20 +0700 Subject: [PATCH] fix build errors --- src/app/api/user/[uid]/workflows/route.ts | 3 +-- src/app/workflows/WorkflowTable.tsx | 2 +- src/types.d.ts | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/api/user/[uid]/workflows/route.ts b/src/app/api/user/[uid]/workflows/route.ts index 6ef2975..ef97cb2 100644 --- a/src/app/api/user/[uid]/workflows/route.ts +++ b/src/app/api/user/[uid]/workflows/route.ts @@ -3,7 +3,6 @@ import { getServerSession } from "next-auth"; import { authOptions } from "@/server/auth"; import { db } from "@/server/db"; import { Logger } from "@/lib/log"; -import { type API } from "~/types/workflows"; const log = new Logger("/api/workflow/[id]"); @@ -36,7 +35,7 @@ export async function GET( createdAt: createdAt?.getTime(), lastRunAt: workflowRuns[0]?.startedAt?.getTime(), }), - ) as API.WorkflowsResponse; + ) as WorkflowResponse[]; log.info(`Returning workflows for user ${session.user.id}`); return NextResponse.json(res); diff --git a/src/app/workflows/WorkflowTable.tsx b/src/app/workflows/WorkflowTable.tsx index 8d9000b..f18965b 100644 --- a/src/app/workflows/WorkflowTable.tsx +++ b/src/app/workflows/WorkflowTable.tsx @@ -247,7 +247,7 @@ const columns: ColumnDef[] = [ accessorKey: "createdAt", cell: ({ row, getValue }) => { const createdAt = getValue() as WorkflowResponse["createdAt"]; - return relativeDate(createdAt); + return relativeDate(createdAt!); }, }, { diff --git a/src/types.d.ts b/src/types.d.ts index 17a7f08..65a6fe7 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -91,7 +91,7 @@ interface WorkflowResponse { name: string; workflow: WorkflowObject; cron?: string; - createdAt: number; + createdAt?: number; lastRunAt?: number; modifiedAt?: number; }