diff options
author | HampusM <hampus@hampusmat.com> | 2021-07-27 12:01:35 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2021-07-27 12:01:35 +0200 |
commit | 69c58c94bd8cc0d469ae301931d4571aca84851a (patch) | |
tree | 0b032c5aea25514fd227c86b4c0694653265db80 /packages/server/src/routes/api/v1/index.ts | |
parent | 77823607c7a06c6abda68beb3a1e827611918fd1 (diff) |
Fixed the repos and repo api endpoints
Diffstat (limited to 'packages/server/src/routes/api/v1/index.ts')
-rw-r--r-- | packages/server/src/routes/api/v1/index.ts | 6 |
1 files changed, 3 insertions, 3 deletions
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 <APIRepositorySummary>{ 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") }; |