fix: use format string for datastar.PostSSE in chat component
All checks were successful
CI / Deploy / test (pull_request) Successful in 16s
CI / Deploy / lint (pull_request) Successful in 24s
CI / Deploy / deploy (pull_request) Has been skipped

PostSSE requires a constant format string; pass "%s" with the URL
as an argument instead of passing the URL directly.
This commit is contained in:
Ryan Hamamura
2026-03-02 19:47:05 -10:00
parent 10de5d21ad
commit f71acfc73e

View File

@@ -43,7 +43,7 @@ templ Chat(messages []chat.Message, cfg Config) {
autocomplete="off"
data-bind="chatMsg"
data-on:keydown.stop=""
data-on:keydown.key_enter={ datastar.PostSSE(cfg.PostURL) }
data-on:keydown.key_enter={ datastar.PostSSE("%s", cfg.PostURL) }
/>
} else {
<input
@@ -51,12 +51,12 @@ templ Chat(messages []chat.Message, cfg Config) {
placeholder="Chat..."
autocomplete="off"
data-bind="chatMsg"
data-on:keydown.enter={ datastar.PostSSE(cfg.PostURL) }
data-on:keydown.enter={ datastar.PostSSE("%s", cfg.PostURL) }
/>
}
<button
type="button"
data-on:click={ datastar.PostSSE(cfg.PostURL) }
data-on:click={ datastar.PostSSE("%s", cfg.PostURL) }
>
Send
</button>