Skip to content

Commit 9809a47

Browse files
committed
feat: update page title
1 parent 3823eeb commit 9809a47

File tree

1 file changed

+2
-1
lines changed
  • apps/book-server/src/services/PageService

1 file changed

+2
-1
lines changed

apps/book-server/src/services/PageService/index.mts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ export class PageService implements Service {
275275
}
276276

277277
if (typeof rest_input.title === 'string') {
278-
Object.assign(updateInput, { title: rest_input.title })
278+
const newUrlSlug = `/${this.utils.escapeForUrl(rest_input.title)}-${page.code}`
279+
Object.assign(updateInput, { title: rest_input.title, url_slug: newUrlSlug })
279280
}
280281

281282
if (typeof rest_input.is_deleted === 'boolean') {

0 commit comments

Comments
 (0)