Fix upload routes & PageId reference
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing

This commit is contained in:
Garrett Mills 2020-11-15 10:59:03 -06:00
parent f7e4c535f8
commit 22611612e5
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246
2 changed files with 3 additions and 4 deletions

View File

@ -186,7 +186,7 @@ class Page extends Controller {
const node_obj = new Node({ const node_obj = new Node({
Type: node.Type, Type: node.Type,
Value: node.Value, Value: node.Value,
PageId, PageId: page.UUID,
CreatedUserId: req.user._id, CreatedUserId: req.user._id,
UpdateUserId: req.user._id, UpdateUserId: req.user._id,
}) })
@ -233,7 +233,7 @@ class Page extends Controller {
const node_obj = new Node({ const node_obj = new Node({
Type: node.Type, Type: node.Type,
Value: node.Value, Value: node.Value,
PageId, PageId: page.UUID,
CreatedUserId: req.user._id, CreatedUserId: req.user._id,
UpdateUserId: req.user._id, UpdateUserId: req.user._id,
}) })

View File

@ -21,9 +21,8 @@ module.exports = exports = {
}, },
post: { post: {
// FIXME - files, not file. Fix in front-end!
// Upload the file in the 'uploaded_file' key to the specified file ref node // 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::auth:ApiRoute',
['middleware::api:DataInjection', { access_level: 'update' }], ['middleware::api:DataInjection', { access_level: 'update' }],
'middleware::upload:UploadFile', 'middleware::upload:UploadFile',