api get page item changed
This commit is contained in:
1 parent
744f127585
commit
b4da11e086
2 files changed
+2
-2
No files matched your search
@@ -4,7 +4,7 @@ import { getPathWithNoTrailingSlash } from '../lib/url'
|
||||
import { encodePage } from '../factory/page'
|
||||
|
||||
export async function getItem(req: Request, res: Response) {
|
||||
const id = req.params.slug
|
||||
const id = req.query.page
|
||||
const page = getPathWithNoTrailingSlash(id)
|
||||
const resource = await Page.findByUrl(page)
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ async function main() {
|
||||
|
||||
app.get('/pages', page.getAll)
|
||||
app.get('/pages/urls', page.getUrls)
|
||||
app.get('/pages/:slug', page.getItem)
|
||||
app.get('/page', page.getItem)
|
||||
|
||||
app.get('/images/:slug', image.getItem)
|
||||
|
||||
|
||||
Reference in new issue
Block a user