diff options
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/authentication/models/current_user_utils.ts | 2 | ||||
| -rw-r--r-- | src/server/index.ts | 10 | ||||
| -rw-r--r-- | src/server/remapUrl.ts | 4 |
3 files changed, 7 insertions, 9 deletions
diff --git a/src/server/authentication/models/current_user_utils.ts b/src/server/authentication/models/current_user_utils.ts index e85aa2c74..add347a88 100644 --- a/src/server/authentication/models/current_user_utils.ts +++ b/src/server/authentication/models/current_user_utils.ts @@ -68,7 +68,7 @@ export class CurrentUserUtils { const extraSchemas = Cast(CurrentUserUtils.UserDocument.DBSchemas, listSpec("string"), []); let extras = await Promise.all(extraSchemas.map(sc => Gateway.Instance.GetSchema("", sc))); let catprom = CurrentUserUtils.SetNorthstarCatalog(await Gateway.Instance.GetCatalog(), extras); - if (catprom) await Promise.all(catprom); + // if (catprom) await Promise.all(catprom); } catch (e) { } diff --git a/src/server/index.ts b/src/server/index.ts index deb3c1bd6..fd66c90b4 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -172,9 +172,9 @@ const pngTypes = [".png", ".PNG"]; const jpgTypes = [".jpg", ".JPG", ".jpeg", ".JPEG"]; const uploadDir = __dirname + "/public/files/"; // SETTERS -addSecureRoute( - Method.POST, - (user, res, req) => { +app.post( + RouteStore.upload, + (req, res) => { let form = new formidable.IncomingForm(); form.uploadDir = uploadDir; form.keepExtensions = true; @@ -212,9 +212,7 @@ addSecureRoute( } res.send(names); }); - }, - undefined, - RouteStore.upload + } ); addSecureRoute( diff --git a/src/server/remapUrl.ts b/src/server/remapUrl.ts index 90044738f..6f4d6642f 100644 --- a/src/server/remapUrl.ts +++ b/src/server/remapUrl.ts @@ -33,7 +33,7 @@ async function update() { if (url.href.includes("azure")) { dynfield = true; - update.$set = { ["fields." + key]: { url: `${url.protocol}//localhost:1050${url.pathname}`, __type: "image" } }; + update.$set = { ["fields." + key + ".url"]: `${url.protocol}//localhost:1050${url.pathname}` }; } } } @@ -47,7 +47,7 @@ async function update() { return new Promise(res => Database.Instance.update(doc[0], doc[1], () => { console.log("wrote " + JSON.stringify(doc[1])); res(); - })); + }, false, "newDocuments")); })); console.log("Done"); // await Promise.all(updates.map(update => { |
