Update SLUG field in server side post_create and put_update hooks.

This commit is contained in:
2022-06-30 15:00:18 +02:00
parent 49896d6978
commit dbbd7c63ed
7 changed files with 55 additions and 14 deletions

View File

@@ -0,0 +1,11 @@
// @ts-check
const { generateArticleSlugUrlString: generateSlugUrlStringByArticle } = require("../lib/helper")
;(function () {
/** @type {import("tibi-types").HookResponse} */
let hookResponse
context.data.article.content.slug = generateSlugUrlStringByArticle(context.data.article)
return hookResponse
})()

View File

@@ -0,0 +1,11 @@
// @ts-check
const { generateArticleSlugUrlString: generateSlugUrlStringByArticle } = require("../lib/helper")
;(function () {
/** @type {import("tibi-types").HookResponse} */
let hookResponse
context.data.article.content.slug = generateSlugUrlStringByArticle(context.data.article)
return hookResponse
})()