diff options
author | HampusM <hampus@hampusmat.com> | 2021-08-08 15:33:22 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2021-08-08 15:33:22 +0200 |
commit | f2d55a9f05f5df7960d7f6dd37d1ef96c762d65a (patch) | |
tree | 737a61da8603520f9afec553791a222f88bc4ff3 /packages/server/src/routes/api/v1/repo/log.ts | |
parent | 17c20d77600407209908de5541415f2c4a85f5e3 (diff) |
Added a tree commit history API endpoint
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 +} |