From 03f7d90520da4a25ce9b4959c2285f7da3b13c95 Mon Sep 17 00:00:00 2001 From: jq1836 <95712150+jq1836@users.noreply.github.com> Date: Sun, 8 Oct 2023 18:48:26 +0800 Subject: [PATCH] Revert back to unsafe type cast --- frontend/src/components/c-ramp.vue | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/c-ramp.vue b/frontend/src/components/c-ramp.vue index 3dbe488e82..5ca70a7b81 100644 --- a/frontend/src/components/c-ramp.vue +++ b/frontend/src/components/c-ramp.vue @@ -142,14 +142,8 @@ export default defineComponent({ } const zoomUser = { ...user }; - // Calculate total commit result insertion and deletion for the daily/weekly commit selected - zoomUser.commits = user.dailyCommits.map( - (dailyCommit) => ({ - insertions: dailyCommit.commitResults.reduce((acc, currCommitResult) => acc + currCommitResult.insertions, 0), - deletions: dailyCommit.commitResults.reduce((acc, currCommitResult) => acc + currCommitResult.deletions, 0), - ...dailyCommit, - }), - ) as Commit[]; + // Type cast here is unsafe + zoomUser.commits = user.dailyCommits as Commit[]; const info = { zRepo: user.repoName,