mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 06:34:39 -04:00
refactor(app.js): Extract note action
This commit is contained in:
parent
e2ac73f5a3
commit
689bade730
2 changed files with 28 additions and 17 deletions
24
lib/web/noteRouter.js
Normal file
24
lib/web/noteRouter.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
'use strict'
|
||||
|
||||
const Router = require('express').Router
|
||||
|
||||
const response = require('../response')
|
||||
|
||||
const noteRouter = module.exports = Router()
|
||||
|
||||
// get new note
|
||||
noteRouter.get('/new', response.newNote)
|
||||
// get publish note
|
||||
noteRouter.get('/s/:shortid', response.showPublishNote)
|
||||
// publish note actions
|
||||
noteRouter.get('/s/:shortid/:action', response.publishNoteActions)
|
||||
// get publish slide
|
||||
noteRouter.get('/p/:shortid', response.showPublishSlide)
|
||||
// publish slide actions
|
||||
noteRouter.get('/p/:shortid/:action', response.publishSlideActions)
|
||||
// get note by id
|
||||
noteRouter.get('/:noteId', response.showNote)
|
||||
// note actions
|
||||
noteRouter.get('/:noteId/:action', response.noteActions)
|
||||
// note actions with action id
|
||||
noteRouter.get('/:noteId/:action/:actionId', response.noteActions)
|
Loading…
Add table
Add a link
Reference in a new issue