2020-04-12 15:39:35 +00:00
|
|
|
import { urlencodedParser } from './utils'
|
|
|
|
import { History } from '../history'
|
2020-04-12 18:45:24 +00:00
|
|
|
import { Router } from 'express'
|
2020-04-12 15:39:35 +00:00
|
|
|
|
2020-04-12 18:45:24 +00:00
|
|
|
const HistoryRouter = Router()
|
2020-04-12 15:39:35 +00:00
|
|
|
|
|
|
|
// get history
|
2020-04-12 18:45:24 +00:00
|
|
|
HistoryRouter.get('/history', History.historyGet)
|
2020-04-12 15:39:35 +00:00
|
|
|
// post history
|
2020-04-12 18:45:24 +00:00
|
|
|
HistoryRouter.post('/history', urlencodedParser, History.historyPost)
|
2020-04-12 15:39:35 +00:00
|
|
|
// post history by note id
|
2020-04-12 18:45:24 +00:00
|
|
|
HistoryRouter.post('/history/:noteId', urlencodedParser, History.historyPost)
|
2020-04-12 15:39:35 +00:00
|
|
|
// delete history
|
2020-04-12 18:45:24 +00:00
|
|
|
HistoryRouter.delete('/history', History.historyDelete)
|
2020-04-12 15:39:35 +00:00
|
|
|
// delete history by note id
|
2020-04-12 18:45:24 +00:00
|
|
|
HistoryRouter.delete('/history/:noteId', History.historyDelete)
|
|
|
|
|
|
|
|
export { HistoryRouter }
|