Migrate project from typing_practiceweb
This commit is contained in:
15
server/routes/practiceTypes.ts
Normal file
15
server/routes/practiceTypes.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import express from 'express';
|
||||
import { PracticeType } from '../models/PracticeType';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.get('/', async (req, res) => {
|
||||
try {
|
||||
const practiceTypes = await PracticeType.find();
|
||||
res.json(practiceTypes);
|
||||
} catch (error) {
|
||||
res.status(500).json({ message: 'Error fetching practice types' });
|
||||
}
|
||||
});
|
||||
|
||||
export default router;
|
||||
Reference in New Issue
Block a user