Browse Source

fix: tags load from editor

pull/1016/head
Nick 5 years ago
parent
commit
22e51c9862
2 changed files with 4 additions and 1 deletions
  1. 3
      server/controllers/common.js
  2. 2
      server/views/editor.pug

3
server/controllers/common.js

@ -71,6 +71,9 @@ router.get(['/e', '/e/*'], async (req, res, next) => {
return res.render('unauthorized', { action: 'edit' }) return res.render('unauthorized', { action: 'edit' })
} }
await page.$relatedQuery('tags')
page.tags = _.map(page.tags, 'tag')
_.set(res.locals, 'pageMeta.title', `Edit ${page.title}`) _.set(res.locals, 'pageMeta.title', `Edit ${page.title}`)
_.set(res.locals, 'pageMeta.description', page.description) _.set(res.locals, 'pageMeta.description', page.description)
page.mode = 'update' page.mode = 'update'

2
server/views/editor.pug

@ -12,7 +12,7 @@ block body
path=page.path path=page.path
title=page.title title=page.title
description=page.description description=page.description
tags=page.tags
:tags=page.tags
:is-published=page.isPublished :is-published=page.isPublished
init-mode=page.mode init-mode=page.mode
init-editor=page.editorKey init-editor=page.editorKey

Loading…
Cancel
Save