From 934d74f0e42695954982d9f74514b68ccbda81ef Mon Sep 17 00:00:00 2001 From: TED Vortex Date: Fri, 30 Dec 2022 20:41:58 +0200 Subject: [PATCH 1/2] fix: correct environment var types --- next-types.d.ts | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/next-types.d.ts b/next-types.d.ts index c701686fc6..591f1cb32b 100644 --- a/next-types.d.ts +++ b/next-types.d.ts @@ -28,7 +28,7 @@ interface DbRepoPR { readonly merged_at: string; readonly updated_at: string; readonly filesCount: number; - protected linesCount: number; + readonly linesCount: number; readonly merged: boolean; readonly repo_owner: string; readonly repo_name: string; @@ -50,6 +50,7 @@ interface Meta { } interface DbContribution { + readonly id: number; readonly commits: string, readonly commit_days: string, readonly files_modified: string, @@ -64,6 +65,7 @@ interface DbContribution { } interface DbInsight { + readonly id: number; readonly interval: number; readonly day: string; readonly all_prs: number; @@ -84,20 +86,20 @@ interface DbInsight { } interface DbUserInsight { - id: number; - user_id: number; - name: string; - is_public: boolean; - is_favorite: boolean; - short_code: string; - created_at: string; - updated_at: string; - repos: DbUserInsightRepo[] + readonly id: number; + readonly user_id: number; + readonly name: string; + readonly is_public: boolean; + readonly is_favorite: boolean; + readonly short_code: string; + readonly created_at: string; + readonly updated_at: string; + readonly repos: DbUserInsightRepo[] } interface DbUserInsightRepo { - id: number; - insight_id: number; - repo_id: number; - created_at: string; + readonly id: number; + readonly insight_id: number; + readonly repo_id: number; + readonly created_at: string; } From 6ae574ef2ca5b29081edbf0737511ed650e5a936 Mon Sep 17 00:00:00 2001 From: TED Vortex Date: Fri, 30 Dec 2022 21:00:08 +0200 Subject: [PATCH 2/2] fix: remove unused api layer and correct build --- next-types.d.ts | 2 +- pages/api/hello.ts | 13 ------------- stories/molecules/insight-page-card.stories.tsx | 4 ++++ 3 files changed, 5 insertions(+), 14 deletions(-) delete mode 100644 pages/api/hello.ts diff --git a/next-types.d.ts b/next-types.d.ts index 591f1cb32b..bb093b1539 100644 --- a/next-types.d.ts +++ b/next-types.d.ts @@ -28,7 +28,7 @@ interface DbRepoPR { readonly merged_at: string; readonly updated_at: string; readonly filesCount: number; - readonly linesCount: number; + linesCount: number; readonly merged: boolean; readonly repo_owner: string; readonly repo_name: string; diff --git a/pages/api/hello.ts b/pages/api/hello.ts deleted file mode 100644 index 941d4faadf..0000000000 --- a/pages/api/hello.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Next.js API route support: https://nextjs.org/docs/api-routes/introduction -import type { NextApiRequest, NextApiResponse } from "next"; - -type Data = { - name: string -} - -export default function handler( - req: NextApiRequest, - res: NextApiResponse -) { - res.status(200).json({ name: "John Doe" }); -} diff --git a/stories/molecules/insight-page-card.stories.tsx b/stories/molecules/insight-page-card.stories.tsx index 9c203de5b7..655540d6b9 100644 --- a/stories/molecules/insight-page-card.stories.tsx +++ b/stories/molecules/insight-page-card.stories.tsx @@ -12,6 +12,7 @@ export default storyConfig; const contributors: DbContribution[] = [ { + id: 1, commits: "2", commit_days: "ES", last_commit_time: "1661496920000", @@ -25,6 +26,7 @@ const contributors: DbContribution[] = [ recent_repo_list: "" }, { + id: 2, commits: "2", commit_days: "ES", last_commit_time: "1661496920000", @@ -38,6 +40,7 @@ const contributors: DbContribution[] = [ recent_repo_list: "" }, { + id: 3, commits: "2", commit_days: "ES", last_commit_time: "1661496920000", @@ -51,6 +54,7 @@ const contributors: DbContribution[] = [ recent_repo_list: "" }, { + id: 4, commits: "2", commit_days: "ES", last_commit_time: "1661496920000",