diff options
Diffstat (limited to 'packages/server/src/routes/api/v1/repo/log.ts')
-rw-r--r-- | packages/server/src/routes/api/v1/repo/log.ts | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/packages/server/src/routes/api/v1/repo/log.ts b/packages/server/src/routes/api/v1/repo/log.ts index 76706b3..b2eea42 100644 --- a/packages/server/src/routes/api/v1/repo/log.ts +++ b/packages/server/src/routes/api/v1/repo/log.ts @@ -3,23 +3,8 @@ import { Commit } from "../../../../git/commit"; import { Patch } from "../../../../git/patch"; import { Route } from "../../../../types/fastify"; import { verifySHA } from "../../util"; -import { LogCommit as APILogCommit, Patch as APIPatch, Commit as APICommit } from "api"; - -async function commitMap(commit: Commit) { - const stats = await commit.stats(); - return <APILogCommit>{ - id: commit.id, - author: { - name: commit.author.name, - email: commit.author.email - }, - message: commit.message, - date: commit.date, - insertions: stats.insertions, - deletions: stats.deletions, - files_changed: stats.files_changed - }; -} +import { Patch as APIPatch, Commit as APICommit } from "api"; +import { commitMap } from "./map"; async function patchMap(patch: Patch) { return <APIPatch>{ @@ -78,4 +63,4 @@ export default function(fastify: FastifyInstance, opts: FastifyPluginOptions, do }); done(); -}
\ No newline at end of file +} |