diff --git a/app/controllers/return-logs.controller.js b/app/controllers/return-logs.controller.js new file mode 100644 index 000000000..1f768418c --- /dev/null +++ b/app/controllers/return-logs.controller.js @@ -0,0 +1,20 @@ +'use strict' + +const EditReturnLogService = require('../services/return-logs/edit-return-log.service.js') + +/** + * Controller for /return-logs endpoints + * @module ReturnLogsController + */ + +async function edit(request, h) { + const { returnLogId } = request.params + + const pageData = EditReturnLogService.go(returnLogId) + + return h.view('return-logs/edit.njk', { activeNavBar: 'search', ...pageData }) +} + +module.exports = { + edit +} diff --git a/app/plugins/router.plugin.js b/app/plugins/router.plugin.js index 5c95c967a..5d488c8cc 100644 --- a/app/plugins/router.plugin.js +++ b/app/plugins/router.plugin.js @@ -28,6 +28,7 @@ const NotificationsSetupRoutes = require('../routes/notifications-setup.routes.j const JobRoutes = require('../routes/jobs.routes.js') const LicenceRoutes = require('../routes/licence.routes.js') const MonitoringStationRoutes = require('../routes/monitoring-station.routes.js') +const ReturnLogRoutes = require('../routes/return-logs.routes.js') const ReturnVersionsSetupRoutes = require('../routes/return-versions-setup.routes.js') const ReturnVersionsRoutes = require('../routes/return-versions.routes.js') const RootRoutes = require('../routes/root.routes.js') @@ -48,6 +49,7 @@ const routes = [ ...LicenceRoutes, ...JobRoutes, ...MonitoringStationRoutes, + ...ReturnLogRoutes, ...ReturnVersionsRoutes, ...ReturnVersionsSetupRoutes, ...DataRoutes, diff --git a/app/routes/return-logs.routes.js b/app/routes/return-logs.routes.js new file mode 100644 index 000000000..1ec430c0d --- /dev/null +++ b/app/routes/return-logs.routes.js @@ -0,0 +1,23 @@ +'use strict' + +const ReturnLogsController = require('../controllers/return-logs.controller.js') + +const routes = [ + { + method: 'GET', + path: '/return-logs/{returnLogId}/edit', + options: { + handler: ReturnLogsController.edit, + app: { + plainOutput: true + }, + auth: { + access: { + scope: ['billing'] + } + } + } + } +] + +module.exports = routes