diff options
| author | jw255 | 2018-04-16 16:08:08 +0100 |
|---|---|---|
| committer | jw255 | 2018-04-16 16:08:08 +0100 |
| commit | d628ed540c883764eff623c7a059bcb588c017bc (patch) | |
| tree | 18e5a1a24fe2fca3bc12103419b1c74be08e9e4f /src | |
| parent | file upload works, i thnk (diff) | |
| download | medicine-d628ed540c883764eff623c7a059bcb588c017bc.tar.gz medicine-d628ed540c883764eff623c7a059bcb588c017bc.zip | |
nothing major
Diffstat (limited to 'src')
| -rw-r--r-- | src/FileRouter.ts | 3 | ||||
| -rw-r--r-- | src/db/model/User.ts | 2 | ||||
| -rw-r--r-- | src/matcher/options.ts | 11 |
3 files changed, 13 insertions, 3 deletions
diff --git a/src/FileRouter.ts b/src/FileRouter.ts index 9a7dcac..f7a1809 100644 --- a/src/FileRouter.ts +++ b/src/FileRouter.ts @@ -689,6 +689,7 @@ export class FileRouter { // TODO Rewrite using sub-queries instead of repeated queries. while (fileNames.length > 2) { const fileOrNull: File | null = await File.findOne({ + include: [{all: true}], where: { name: fileNames[0], parentFolder: file @@ -703,7 +704,7 @@ export class FileRouter { } const parentFolder: File | null = await File.findOne({ include: [ - { model: File, as: 'containedFilesInternal'}, + { model: File, as: 'containedFilesInternal'} ], where: { //parentFolder: file, diff --git a/src/db/model/User.ts b/src/db/model/User.ts index 3a0ef26..73d2356 100644 --- a/src/db/model/User.ts +++ b/src/db/model/User.ts @@ -126,14 +126,12 @@ export default class User extends Model<User> { } public get fullInfo(): UserFullInfo { - console.log("fullinfo called") // FIXME: Fetch these things if they aren't already present if (this.userGroups === undefined) { this.userGroups = []; } else if (this.projects === undefined) { this.projects = []; } - console.log("2") return { username : this.username, privileges: this.userGroups! diff --git a/src/matcher/options.ts b/src/matcher/options.ts index 0513eb3..967a6f9 100644 --- a/src/matcher/options.ts +++ b/src/matcher/options.ts @@ -15,13 +15,20 @@ export type Value = const matchNoCurry: (template: TemplateValue, value: Value | undefined) => boolean = (template: TemplateValue, value: Value | undefined): boolean => { + console.log("matchNoCurry()") + console.log(template) + console.log(value) if (types.atom(template)) { + console.log("atom") return template === value; } else if (types.function(template)) { + console.log("function") return template(value); } else if (types.atom(value) || value === undefined) { + console.log("atom2") return false; } else if (types.object(template)) { + console.log("object") return Object.keys(template) .every((key: string): boolean => { const v: Value | undefined = value[key]; @@ -34,7 +41,11 @@ const matchNoCurry: // tslint:disable-next-line:typedef export const match = (template: TemplateValue, value?: Value) => { + console.log("match()") + console.log(template) + console.log(value) if (value === undefined) { + console.log("is undefined") return matchNoCurry.bind(null, template); } return matchNoCurry(template, value); |
