From 91bd77b746096921341b8eb81a50505c6f34a1ff Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 20 Nov 2024 22:46:57 -0500 Subject: [PATCH] chore: remove typefully integration --- server/api/question.ts | 1 - server/utils/typefully.ts | 20 -------------------- 2 files changed, 21 deletions(-) delete mode 100644 server/utils/typefully.ts diff --git a/server/api/question.ts b/server/api/question.ts index 3b099fd21..0cc83c752 100644 --- a/server/api/question.ts +++ b/server/api/question.ts @@ -7,7 +7,6 @@ export default defineEventHandler(async event => { if (!question) throw createError({ statusCode: 422 }) event.waitUntil(sanity.client.create({ _type: 'ama', content: question }).catch(console.error)) - event.waitUntil(createTypefullyDraft(event, question).catch(console.error)) await sendEmail(event, 'Anonymous question', question) return null diff --git a/server/utils/typefully.ts b/server/utils/typefully.ts deleted file mode 100644 index 642690e4f..000000000 --- a/server/utils/typefully.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { H3Event } from 'h3' - -export async function createTypefullyDraft (event: H3Event, text: string) { - const content = ` -${text} - -https://roe.dev/ama - -#ama` - return await $fetch('/drafts/', { - baseURL: 'https://api.typefully.com/v1', - method: 'POST', - headers: { - 'X-API-KEY': useRuntimeConfig(event).typefully.apiKey, - }, - body: { - content, - }, - }) -}