1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-08-10 07:55:24 +02:00

fixed link to parent page

This commit is contained in:
nvc8996 2021-10-22 17:26:28 +03:00
parent c86c00b463
commit da6f386687
2 changed files with 2 additions and 2 deletions

View file

@ -132,7 +132,7 @@ class Page {
* *
* @returns {Promise<Page>} * @returns {Promise<Page>}
*/ */
public async getParent(): Promise<Page|null> { public async getParent(): Promise<Page> {
const data = await pagesDb.findOne({ _id: this._parent }); const data = await pagesDb.findOne({ _id: this._parent });
return new Page(data); return new Page(data);

View file

@ -30,7 +30,7 @@ router.get('*', verifyToken, async (req: Request, res: Response) => {
case Alias.types.PAGE: { case Alias.types.PAGE: {
const page = await Pages.get(alias.id); const page = await Pages.get(alias.id);
const pageParent = page.parent; const pageParent = await page.getParent();
res.render('pages/page', { res.render('pages/page', {
page, page,