add withMiddleware for all api routes. Now it do nothing
This commit is contained in:
1 parent
cd7536f74f
commit
95c8369df2
16 files changed
+48
-30
No files matched your search
@@ -2,8 +2,9 @@ import { connect } from '../../../src/core/db'
|
||||
import Teacher from '../../../src/core/Teacher'
|
||||
import { prioritySort } from '../../../src/lib/sort'
|
||||
import { encodePerson } from '../../../src/api/persons'
|
||||
import { withMiddleware } from '../../../src/middlewares/withMiddleware'
|
||||
|
||||
export default async (req, res) => {
|
||||
export default withMiddleware(async (req, res) => {
|
||||
await connect()
|
||||
|
||||
const order = [
|
||||
@@ -29,4 +30,4 @@ export default async (req, res) => {
|
||||
error: `Article ${id} not found`
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user