aboutsummaryrefslogtreecommitdiff
path: root/packages/server/src/api/v1/repo/branches.ts
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2021-07-21 22:00:04 +0200
committerHampusM <hampus@hampusmat.com>2021-07-21 22:00:04 +0200
commit7b9fca8d0061cf5e5af08cba98e9d5b6dbbed8ec (patch)
tree2a75dfaaa495c90e5519012e2c8e20ab0bd7ac4e /packages/server/src/api/v1/repo/branches.ts
parentc0eb6635964de276b44851df67fb857ae94dc401 (diff)
Began with better backend error handling & cleaned up the backend
Diffstat (limited to 'packages/server/src/api/v1/repo/branches.ts')
-rw-r--r--packages/server/src/api/v1/repo/branches.ts4
1 files changed, 2 insertions, 2 deletions
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!" });