From 22611612e549af4a403b6bc20f24f05014ef950b Mon Sep 17 00:00:00 2001 From: garrettmills Date: Sun, 15 Nov 2020 10:59:03 -0600 Subject: [PATCH] Fix upload routes & PageId reference --- app/controllers/api/v1/Page.controller.js | 4 ++-- app/routing/routers/api/v1/files.routes.js | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/controllers/api/v1/Page.controller.js b/app/controllers/api/v1/Page.controller.js index d9f9193..5b1c291 100644 --- a/app/controllers/api/v1/Page.controller.js +++ b/app/controllers/api/v1/Page.controller.js @@ -186,7 +186,7 @@ class Page extends Controller { const node_obj = new Node({ Type: node.Type, Value: node.Value, - PageId, + PageId: page.UUID, CreatedUserId: req.user._id, UpdateUserId: req.user._id, }) @@ -233,7 +233,7 @@ class Page extends Controller { const node_obj = new Node({ Type: node.Type, Value: node.Value, - PageId, + PageId: page.UUID, CreatedUserId: req.user._id, UpdateUserId: req.user._id, }) diff --git a/app/routing/routers/api/v1/files.routes.js b/app/routing/routers/api/v1/files.routes.js index dc22758..aec354b 100644 --- a/app/routing/routers/api/v1/files.routes.js +++ b/app/routing/routers/api/v1/files.routes.js @@ -21,9 +21,8 @@ module.exports = exports = { }, post: { - // FIXME - files, not file. Fix in front-end! // Upload the file in the 'uploaded_file' key to the specified file ref node - '/file/upload/:PageId/:NodeId/:FilesId': [ + '/upload/:PageId/:NodeId/:FilesId': [ 'middleware::auth:ApiRoute', ['middleware::api:DataInjection', { access_level: 'update' }], 'middleware::upload:UploadFile',