backend/app/routing/routers/api/v1/code.routes.js
garrettmills 42b7ccad7f
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
Create data injection middleware and start centralizing lookups
2020-11-11 13:54:20 -06:00

39 lines
1.2 KiB
JavaScript

module.exports = exports = {
prefix: '/api/v1/code',
middleware: [],
get: {
// Get the code ref node config for the specified code editor
'/:PageId/:NodeId/get/:CodiumId': [
'middleware::auth:ApiRoute',
['middleware::api:DataInjection', { access_level: 'view' }],
'controller::api:v1:FormCode.get_config',
],
},
post: {
// Create a new code ref config
'/:PageId/:NodeId/create': [
'middleware::auth:ApiRoute',
['middleware::api:DataInjection', { access_level: 'update' }],
'controller::api:v1:FormCode.create_new',
],
// Set the data for the specified code ref
'/:PageId/:NodeId/set/:CodiumId': [
'middleware::auth:ApiRoute',
['middleware::api:DataInjection', { access_level: 'update' }],
'controller::api:v1:FormCode.set_values',
],
// delete the specified code ref
'/:PageId/:NodeId/delete/:CodiumId': [
'middleware::auth:ApiRoute',
['middleware::api:DataInjection', { access_level: 'update' }],
'controller::api:v1:FormCode.drop_code',
],
},
}