fix: fix discord webhook env name

This commit is contained in:
Hossein Mehrabi 2023-09-18 14:05:59 +03:30
parent ab0e258fe2
commit 3804ef33ef
No known key found for this signature in database
GPG Key ID: 45C04964191AFAA1
4 changed files with 8 additions and 2 deletions

2
.env
View File

@ -2,5 +2,5 @@ UNBODY_API_KEY=
UNBODY_PROJECT_ID=
SIMPLECAST_ACCESS_TOKEN=
REVALIDATE_WEBHOOK_TOKEN=
DISCORD_WEBHOOK=
DISCORD_LOGS_WEBHOOK_URL=
NEXT_PUBLIC_SITE_URL=https://press.logos.co

View File

@ -103,6 +103,7 @@ export const PodcastEpisodeDataType: UnbodyDataTypeConfig<
title: data.title,
authors: data.authors,
description: data.summary,
modifiedAt: data.modifiedAt || '',
publishedAt: publishedAt.toJSON(),
episodeNumber,
tags: data.tags,

View File

@ -41,7 +41,7 @@ const isBuildTime = process.env.NEXT_PHASE === PHASE_PRODUCTION_BUILD
const isVercel = process.env.VERCEL === '1'
const websiteUrl = getWebsiteUrl()
const discordWebhookURL = process.env.DISCORD_WEBHOOK || ''
const discordWebhookURL = process.env.DISCORD_LOGS_WEBHOOK_URL || ''
const discordWebhookUsername = 'Logos Press Engine'
const discordWebhookAvatarURL = 'https://press.logos.co/logo.png'
const sendDiscordNotifications =
@ -418,12 +418,16 @@ export class UnbodyService {
const isUpdated =
JSON.stringify([
getRecordDate(record),
record.modifiedAt,
record.type === 'podcast' && record.episodeNumber,
record.slug,
record.isDraft,
'highlighted' in record && record.highlighted,
]) !==
JSON.stringify([
getRecordDate(oldRecord),
oldRecord.modifiedAt,
record.type === 'podcast' && record.episodeNumber,
oldRecord.slug,
oldRecord.isDraft,
'highlighted' in oldRecord && oldRecord.highlighted,

View File

@ -216,6 +216,7 @@ export namespace LPE {
description: string
authors: Author.Document[]
publishedAt: string
modifiedAt: string
episodeNumber: number
showId?: string
highlighted?: boolean