From df341dc9b874f7e7bf99d9c1de3a84c49c4a04a6 Mon Sep 17 00:00:00 2001 From: HampusM Date: Fri, 25 Jun 2021 13:21:56 +0200 Subject: Cleaned up the backend --- packages/server/src/api/v1/repo/log.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/server/src/api/v1/repo/log.ts') diff --git a/packages/server/src/api/v1/repo/log.ts b/packages/server/src/api/v1/repo/log.ts index d21cfa8..aa6fa1a 100644 --- a/packages/server/src/api/v1/repo/log.ts +++ b/packages/server/src/api/v1/repo/log.ts @@ -20,14 +20,14 @@ async function commitMap(commit: Commit) { }; } -async function patchMap(patch: Patch) { +async function patchMap(patch: Patch, index: number) { return { additions: patch.additions, deletions: patch.deletions, from: patch.from, to: patch.to, - too_large: patch.too_large, - hunks: await patch.getHunks() + too_large: await patch.isTooLarge(index), + hunks: await patch.getHunks(index) }; } @@ -68,7 +68,7 @@ export default function(fastify: FastifyInstance, opts: FastifyPluginOptions, do insertions: stats.insertions, deletions: stats.deletions, files_changed: stats.files_changed, - diff: await Promise.all((await (await commit.diff()).getPatches()).map(patchMap)) + diff: await Promise.all((await (await commit.diff()).patches()).map(patchMap)) } }); } -- cgit v1.2.3-18-g5258