api article fix missing import; js -> ts
This commit is contained in:
1 parent
d2f9a39d33
commit
a597a0d061
1 file changed
+5
-6
@@ -1,10 +1,9 @@
|
||||
import { connect } from '../../../src/core/db'
|
||||
import { NextApiRequest, NextApiResponse } from 'next'
|
||||
import Article from '../../../src/core/Article'
|
||||
import { encodeArticle } from '../../../src/api/articles'
|
||||
|
||||
export default async (req, res) => {
|
||||
await connect()
|
||||
import { encodeArticle } from '../../../src/server/articles'
|
||||
import { withMiddleware } from '../../../src/middlewares/withMiddleware'
|
||||
|
||||
export default withMiddleware(async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
const {
|
||||
query: { article: id }
|
||||
} = req;
|
||||
@@ -19,4 +18,4 @@ export default async (req, res) => {
|
||||
error: `Article ${id} not found`
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user