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 { entry } = Astro.props;
|
||||||
|
|
||||||
const host = import.meta.env.PROD
|
|
||||||
? import.meta.env.SITE
|
|
||||||
: "http://localhost:8000";
|
|
||||||
|
|
||||||
export async function getStaticPaths() {
|
export async function getStaticPaths() {
|
||||||
const blogEntries = await getCollection("blog");
|
const blogEntries = await getCollection("blog");
|
||||||
return blogEntries.map((entry) => ({
|
return blogEntries.map((entry) => ({
|
||||||
|
@ -36,13 +32,19 @@ export async function getStaticPaths() {
|
||||||
<Layout title="log101">
|
<Layout title="log101">
|
||||||
<Header />
|
<Header />
|
||||||
<Post post={entry} componentType="full" />
|
<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
|
<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-trigger="load"
|
||||||
hx-swap="innerHTML"
|
hx-swap="innerHTML"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
</form>
|
||||||
<Footer />
|
<Footer />
|
||||||
|
|
||||||
<script></script>
|
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user