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