diff --git a/package.json b/package.json index 37f54063..a9181af2 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,7 @@ "remark": "^15.0.1", "remark-html": "^16.0.1", "rollup-plugin-node-polyfills": "^0.2.1", + "scule": "^1.3.0", "std-env": "^3.9.0", "ufo": "^1.6.1", "unocss": "^66.1.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8b39571e..a088d4db 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -160,6 +160,9 @@ importers: rollup-plugin-node-polyfills: specifier: ^0.2.1 version: 0.2.1 + scule: + specifier: ^1.3.0 + version: 1.3.0 std-env: specifier: ^3.9.0 version: 3.9.0 diff --git a/server/api/publish-ama.post.ts b/server/api/publish-ama.post.ts index d46bbfe5..edce4ae8 100644 --- a/server/api/publish-ama.post.ts +++ b/server/api/publish-ama.post.ts @@ -8,6 +8,7 @@ import { isValidSignature, SIGNATURE_HEADER_NAME } from '@sanity/webhook' import type { PortableTextBlock } from '@portabletext/types' import { parseURL, withProtocol } from 'ufo' +import { camelCase } from 'scule' import { resolveTextForPlatform, resolveTextWithFacets } from '../utils/sanity/blocks' interface AMADocument { @@ -185,7 +186,7 @@ export default defineEventHandler(async event => { const publishedLinks: Record = {} results.forEach(result => { if (result.success && result.url) { - publishedLinks[result.platform] = result.url + publishedLinks[camelCase(result.platform)] = result.url } }) diff --git a/server/api/question.ts b/server/api/question.ts index 176c4403..2beb47aa 100644 --- a/server/api/question.ts +++ b/server/api/question.ts @@ -18,6 +18,7 @@ export default defineEventHandler(async event => { mastodon: true, tiktok: false, tiktokStories: false, + youtubeShorts: true, }, }).catch(console.error))