From 7b9fca8d0061cf5e5af08cba98e9d5b6dbbed8ec Mon Sep 17 00:00:00 2001 From: HampusM Date: Wed, 21 Jul 2021 22:00:04 +0200 Subject: Began with better backend error handling & cleaned up the backend --- packages/server/src/api/v1/repo/branches.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/server/src/api/v1/repo/branches.ts') diff --git a/packages/server/src/api/v1/repo/branches.ts b/packages/server/src/api/v1/repo/branches.ts index b280a4a..c01e858 100644 --- a/packages/server/src/api/v1/repo/branches.ts +++ b/packages/server/src/api/v1/repo/branches.ts @@ -8,7 +8,7 @@ export default function(fastify: FastifyInstance, opts: FastifyPluginOptions, do method: "GET", url: "/branches", handler: async(req, reply) => { - const branches = await (await req.repository).branches(); + const branches = await req.repository.branches(); reply.send({ data: branches.map(branch => { @@ -25,7 +25,7 @@ export default function(fastify: FastifyInstance, opts: FastifyPluginOptions, do method: "GET", url: "/branches/:branch", handler: async(req, reply) => { - const branch = await Branch.lookup(await req.repository, req.params.branch); + const branch = await Branch.lookup(req.repository, req.params.branch); if(!branch) { reply.code(404).send({ error: "Branch not found!" }); -- cgit v1.2.3-18-g5258