feat: update hx-get directive target
All checks were successful
/ Build (push) Successful in 1m3s

This commit is contained in:
log101 2024-05-30 13:16:29 +03:00
parent 3b46305c63
commit 17c86c0926

View File

@ -8,6 +8,8 @@ import Post from "@/components/Post.astro";
const { entry } = Astro.props;
const host = import.meta.env.PROD ? import.meta.env.SITE : "http://localhost";
export async function getStaticPaths() {
const blogEntries = await getCollection("blog");
return blogEntries.map((entry) => ({
@ -33,7 +35,7 @@ export async function getStaticPaths() {
<Header />
<Post post={entry} componentType="full" />
<div
hx-get=`http://localhost:8000/forms/emoji?postId=${entry.id}`
hx-get=`${host}/api/forms/emoji?postId=${entry.id}`
hx-trigger="load"
hx-swap="innerHTML"
>