diff --git a/.gitea/workflows/src/utils/urlHelpers.ts b/.gitea/workflows/src/utils/urlHelpers.ts index e8b2c6a..b39bcdc 100644 --- a/.gitea/workflows/src/utils/urlHelpers.ts +++ b/.gitea/workflows/src/utils/urlHelpers.ts @@ -18,7 +18,8 @@ export const createSlug = (text: string): string => { * Example: "Ad ut neque enim omn", "e7d611b6-853b-4785-b508-599eeed2af92" -> "ad-ut-neque-enim-omn-e7d611b6-853b-4785-b508-599eeed2af92" */ export const getSlugWithId = (title: string, id: string) => { - return `${createSlug(title)}-${id}`; + const slug = createSlug(title); + return slug && id ? `${slug}-${id}` : slug || id; }; /**