diff --git a/components/form/broadcast/content-blast-form.tsx b/components/form/broadcast/content-blast-form.tsx index 5453ac62..d7cac489 100644 --- a/components/form/broadcast/content-blast-form.tsx +++ b/components/form/broadcast/content-blast-form.tsx @@ -144,17 +144,30 @@ export default function ContentBlast(props: { type: string }) { const response = await detailMediaSummary(String(id)); const details = response?.data?.data; let pageUrl = details?.pageUrl || ""; - if (process.env.NODE_ENV === "production") { - pageUrl = pageUrl.replace(/(\.com|\.id)(\/|$)/, "$1/in$2"); + if (pageUrl.includes("mediahub.polri.go.id")) { + pageUrl = pageUrl.replace( + /(\.id)(\/|$)/, + (match: any, p1: any, p2: any) => { + return p2.startsWith("/in") ? match : `${p1}/in${p2}`; + } + ); } if (details != undefined) { form.setValue("thumbnail", details.smallThumbnailLink); - let body = `

Berita hari ini !!!

${pageUrl}

${ - details?.title - }

- ${textEllipsis(details?.description, 150)}

`; + let body = `

Berita hari ini !!!

+
+
+ +
+ ${pageUrl} +

${details?.title}

+

+ ${textEllipsis(details?.description, 150)} +

+
+
`; form.setValue("title", `${details?.title}`); form.setValue( "url",