chore: change form triggers
All checks were successful
/ build-and-push-image (push) Successful in 19s
All checks were successful
/ build-and-push-image (push) Successful in 19s
This commit is contained in:
parent
cedbc8af9d
commit
7ebe19f905
|
@ -8,10 +8,6 @@ import Post from "@/components/Post.astro";
|
|||
|
||||
const { entry } = Astro.props;
|
||||
|
||||
const host = import.meta.env.PROD
|
||||
? import.meta.env.SITE
|
||||
: "http://localhost:8000";
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const blogEntries = await getCollection("blog");
|
||||
return blogEntries.map((entry) => ({
|
||||
|
@ -36,13 +32,19 @@ export async function getStaticPaths() {
|
|||
<Layout title="log101">
|
||||
<Header />
|
||||
<Post post={entry} componentType="full" />
|
||||
|
||||
<form
|
||||
hx-post="http://localhost:8000/blog/api/forms/emoji/post"
|
||||
hx-target="#reaction-buttons"
|
||||
>
|
||||
<input type="hidden" name="postId" value=`${entry.id}` />
|
||||
<div
|
||||
hx-get=`${host}/blog/api/forms/emoji?postId=${entry.id}`
|
||||
id="reaction-buttons"
|
||||
hx-get=`http://localhost:8000/blog/api/forms/emoji?postId=${entry.id}`
|
||||
hx-trigger="load"
|
||||
hx-swap="innerHTML"
|
||||
>
|
||||
</div>
|
||||
</form>
|
||||
<Footer />
|
||||
|
||||
<script></script>
|
||||
</Layout>
|
||||
|
|
Loading…
Reference in New Issue
Block a user