From 69c58c94bd8cc0d469ae301931d4571aca84851a Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 27 Jul 2021 12:01:35 +0200 Subject: Fixed the repos and repo api endpoints --- packages/server/src/routes/api/v1/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'packages/server/src/routes/api/v1') diff --git a/packages/server/src/routes/api/v1/index.ts b/packages/server/src/routes/api/v1/index.ts index d956063..62ae5d7 100644 --- a/packages/server/src/routes/api/v1/index.ts +++ b/packages/server/src/routes/api/v1/index.ts @@ -32,7 +32,7 @@ function reposEndpoints(fastify: FastifyInstance, opts: FastifyPluginOptions, do data: await Promise.all(repos.map(async repository => { return { name: repository.name.short, - description: repository.description, + description: await repository.description(), last_updated: (await repository.masterCommit()).date }; })) @@ -49,7 +49,7 @@ function reposEndpoints(fastify: FastifyInstance, opts: FastifyPluginOptions, do return; } - const repository = await Repository.open(opts.config.settings.base_dir, req.params.repo).catch(err => err); + const repository: Repository | BaseError = await Repository.open(opts.config.settings.base_dir, req.params.repo).catch(err => err); if(repository instanceof BaseError) { reply.code(repository.code).send({ error: repository.message }); @@ -58,7 +58,7 @@ function reposEndpoints(fastify: FastifyInstance, opts: FastifyPluginOptions, do const data: APIRepository = { name: repository.name.short, - description: repository.description, + description: await repository.description(), has_readme: await (await repository.tree()).findExists("README.md") }; -- cgit v1.2.3-18-g5258