fix: pass notification settings from create form to service
All checks were successful
Check / check (pull_request) Successful in 3m40s

HandleAppCreate was not reading docker_network, ntfy_topic, or
slack_webhook form values, so these fields were silently dropped
during app creation. The app_new.html template had the form fields,
and CreateAppInput/CreateApp already supported these fields, but the
handler never passed them through.

Also adds these values to the template re-render data so they are
preserved if a validation error occurs during creation.
This commit is contained in:
clawbot
2026-03-06 03:41:36 -08:00
parent 1cd433b069
commit fd836b9210

View File

@@ -54,12 +54,18 @@ func (h *Handlers) HandleAppCreate() http.HandlerFunc { //nolint:funlen // valid
repoURL := request.FormValue("repo_url")
branch := request.FormValue("branch")
dockerfilePath := request.FormValue("dockerfile_path")
dockerNetwork := request.FormValue("docker_network")
ntfyTopic := request.FormValue("ntfy_topic")
slackWebhook := request.FormValue("slack_webhook")
data := h.addGlobals(map[string]any{
"Name": name,
"RepoURL": repoURL,
"Branch": branch,
"DockerfilePath": dockerfilePath,
"DockerNetwork": dockerNetwork,
"NtfyTopic": ntfyTopic,
"SlackWebhook": slackWebhook,
}, request)
if name == "" || repoURL == "" {
@@ -100,6 +106,9 @@ func (h *Handlers) HandleAppCreate() http.HandlerFunc { //nolint:funlen // valid
RepoURL: repoURL,
Branch: branch,
DockerfilePath: dockerfilePath,
DockerNetwork: dockerNetwork,
NtfyTopic: ntfyTopic,
SlackWebhook: slackWebhook,
},
)
if createErr != nil {