From 3b36e2e0e6f67a94b24779d3cf60fde3e6e6bcd8 Mon Sep 17 00:00:00 2001 From: Philip Molares Date: Sun, 12 Apr 2020 20:55:17 +0200 Subject: [PATCH] fixed lib/web/note/router.ts Signed-off-by: Philip Molares Signed-off-by: David Mehren --- lib/web/note/router.ts | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/lib/web/note/router.ts b/lib/web/note/router.ts index 713c1c9e7..7eecd08c9 100644 --- a/lib/web/note/router.ts +++ b/lib/web/note/router.ts @@ -1,27 +1,29 @@ -import {markdownParser} from "../utils"; +import { markdownParser } from '../utils' -import {SlideController} from "./slide"; -import {NoteController} from "./controller"; -import {Router} from "express"; +import { SlideController } from './slide' +import { NoteController } from './controller' +import { Router } from 'express' -const router = module.exports = Router(); +const NoteRouter = Router() // get new note -router.get('/new', NoteController.createFromPOST); +NoteRouter.get('/new', NoteController.createFromPOST) // post new note with content -router.post('/new', markdownParser, NoteController.createFromPOST); +NoteRouter.post('/new', markdownParser, NoteController.createFromPOST) // post new note with content and alias -router.post('/new/:noteId', markdownParser, NoteController.createFromPOST); +NoteRouter.post('/new/:noteId', markdownParser, NoteController.createFromPOST) // get publish note -router.get('/s/:shortid', NoteController.showPublishNote); +NoteRouter.get('/s/:shortid', NoteController.showPublishNote) // publish note actions -router.get('/s/:shortid/:action', NoteController.publishNoteActions); +NoteRouter.get('/s/:shortid/:action', NoteController.publishNoteActions) // get publish slide -router.get('/p/:shortid', SlideController.showPublishSlide); +NoteRouter.get('/p/:shortid', SlideController.showPublishSlide) // publish slide actions -router.get('/p/:shortid/:action', SlideController.publishSlideActions); +NoteRouter.get('/p/:shortid/:action', SlideController.publishSlideActions) // get note by id -router.get('/:noteId', NoteController.showNote); +NoteRouter.get('/:noteId', NoteController.showNote) // note actions -router.get('/:noteId/:action', NoteController.doAction); +NoteRouter.get('/:noteId/:action', NoteController.doAction) // note actions with action id -router.get('/:noteId/:action/:actionId', NoteController.doAction); +NoteRouter.get('/:noteId/:action/:actionId', NoteController.doAction) + +export { NoteRouter }