-
Notifications
You must be signed in to change notification settings - Fork 1
/
admin.ts
24 lines (16 loc) · 744 Bytes
/
admin.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import express,{ Request, Response} from 'express';
import { createAdmin, deleteAdmin, getAdmin, getAdmins, updateAdmin } from '../controllers/admin/adminController';
// import { isCached, isCached1 } from '../middlewares/cache';
const router = express.Router();
router.post('/new_admin', async (request:Request, response: Response)=>{
try {
const { firstName, lastName, contact, email}= request.body
const response= await createAdmin({firstName,lastName,contact,email})
} catch (error) {
}
})
router.get('/view_admins', getAdmins)
router.get('/view_admin/:id', getAdmin)
router.put('/edit_admin/:id', updateAdmin)
router.delete('/remove_admin/:id', deleteAdmin)
export { router as adminRoute };