diff options
| author | cjd24 | 2018-04-19 20:48:19 +0100 |
|---|---|---|
| committer | cjd24 | 2018-04-19 20:48:19 +0100 |
| commit | 92e23d37f843e49eda01a4d0ea7ed8005efffdb2 (patch) | |
| tree | 7c08678dfce9bf82eaa4f71f5e23182f8515d386 /src/db/model/User.ts | |
| parent | Added a write of the base teir JSON object, made the images actually write to... (diff) | |
| parent | Merge branch 'trh/gets' into cjd24/conversion (diff) | |
| download | medicine-92e23d37f843e49eda01a4d0ea7ed8005efffdb2.tar.gz medicine-92e23d37f843e49eda01a4d0ea7ed8005efffdb2.zip | |
Merge branch ‘cjd24/conversion’ of https://gitlab.cs.st-andrews.ac.uk/cs3099group-be-4/project-code into cjd24/conversion
Diffstat (limited to 'src/db/model/User.ts')
| -rw-r--r-- | src/db/model/User.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/db/model/User.ts b/src/db/model/User.ts index 171e899..73d2356 100644 --- a/src/db/model/User.ts +++ b/src/db/model/User.ts @@ -128,16 +128,16 @@ export default class User extends Model<User> { public get fullInfo(): UserFullInfo { // FIXME: Fetch these things if they aren't already present if (this.userGroups === undefined) { - throw new Error('userGroups undefined'); + this.userGroups = []; } else if (this.projects === undefined) { - throw new Error('projects undefined'); + this.projects = []; } return { username : this.username, - privileges: this.userGroups + privileges: this.userGroups! .filter((ug: UserGroup): boolean => ug.name !== null) .map((ug: UserGroup): string => ug.name as string), - projects : this.projects.map( + projects : this.projects!.map( (p: Project): ProjectInfo => this.getProjectInfo(p) ), // TODO: Check if we have anything to use these for yet? |
