diff options
| author | josh97josh | 2018-04-20 23:47:19 +0100 |
|---|---|---|
| committer | josh97josh | 2018-04-20 23:47:19 +0100 |
| commit | 9ea66944ccb2c7c4dfa5f80bf1ef4637636d9a9f (patch) | |
| tree | 5923488d4ea27371557972ff0dd238f228d8b284 /src/FileRouter.ts | |
| parent | Merge branch 'trh/gets' into 'jl247/permissions' (diff) | |
| download | medicine-9ea66944ccb2c7c4dfa5f80bf1ef4637636d9a9f.tar.gz medicine-9ea66944ccb2c7c4dfa5f80bf1ef4637636d9a9f.zip | |
get project fixed
Diffstat (limited to 'src/FileRouter.ts')
| -rw-r--r-- | src/FileRouter.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/FileRouter.ts b/src/FileRouter.ts index 0882272..dc57ab2 100644 --- a/src/FileRouter.ts +++ b/src/FileRouter.ts @@ -14,6 +14,7 @@ import { uuid } from './uuid'; import UserHasPrivilege from './db/model/UserHasPrivilege'; import { Contains } from 'sequelize-typescript'; import UserJoinsProject from './db/model/UserJoinsProject'; +import { appendFileSync } from 'fs'; /** @@ -481,9 +482,9 @@ const getProjects: Middleware = async( User ] }); - res.locals.data = projects.map( - (p: Project): ProjectFullInfo => p.fullInfo - ); + res.locals.data = Promise.all(projects.map( + (p: Project): Promise<ProjectFullInfo> => p.getFullInfo() + )); next(); }; @@ -513,7 +514,7 @@ const getProjectName: Middleware = async( if (project == null) { return next(new RequestError(404, 'project_not_found')); } else { - res.locals.data = project.fullInfo; + res.locals.data = await project.getFullInfo(); next(); } }; |
