diff --git a/modules/hudozka-api/src/controllers/page.ts b/modules/hudozka-api/src/controllers/page.ts index e3c835db..242b7040 100644 --- a/modules/hudozka-api/src/controllers/page.ts +++ b/modules/hudozka-api/src/controllers/page.ts @@ -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) diff --git a/modules/hudozka-api/src/server.ts b/modules/hudozka-api/src/server.ts index 53c51691..7002bf6f 100644 --- a/modules/hudozka-api/src/server.ts +++ b/modules/hudozka-api/src/server.ts @@ -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)