2023-06-26 17:01:40 +00:00
|
|
|
/* eslint-disable @typescript-eslint/no-misused-promises */
|
|
|
|
import { Router } from 'express'
|
|
|
|
|
|
|
|
// Controllers
|
2023-07-28 13:41:28 +00:00
|
|
|
import post from './posts'
|
2023-06-26 17:01:40 +00:00
|
|
|
|
|
|
|
// Middlewares
|
2023-07-28 13:41:28 +00:00
|
|
|
import authenticated from '../middlewares/authenticated'
|
2023-06-26 17:01:40 +00:00
|
|
|
|
|
|
|
const postsRouter = Router()
|
|
|
|
|
2023-07-28 13:41:28 +00:00
|
|
|
// GET
|
|
|
|
postsRouter.get('/fetch-likes', post.fetchLikes)
|
|
|
|
postsRouter.get('/info', post.fetch)
|
|
|
|
|
|
|
|
// POST
|
|
|
|
postsRouter.post('/create', authenticated, post.create)
|
|
|
|
postsRouter.post('/delete', authenticated, post.delete)
|
|
|
|
|
|
|
|
// PUT
|
|
|
|
postsRouter.put('/update', authenticated, post.update)
|
2023-06-26 17:01:40 +00:00
|
|
|
|
|
|
|
export default postsRouter
|