fix: pass notification settings from create form to service (#160)
All checks were successful
Check / check (push) Successful in 3m49s
All checks were successful
Check / check (push) Successful in 3m49s
## Summary `HandleAppCreate` was not reading `docker_network`, `ntfy_topic`, or `slack_webhook` form values from the create app form. These fields were silently dropped during app creation, even though: - `app_new.html` had the form fields - `CreateAppInput` had the corresponding struct fields - `CreateApp` already handled them correctly The edit/update flow was unaffected — the bug was exclusively in the create path. ## Changes - Read `docker_network`, `ntfy_topic`, `slack_webhook` form values in `HandleAppCreate` - Pass them to `CreateAppInput` - Include them in template re-render data (preserves values on validation errors) closes #157 <!-- session: agent:sdlc-manager:subagent:1fb3582d-1eff-4309-b166-df5046a1b885 --> Co-authored-by: clawbot <clawbot@noreply.git.eeqj.de> Reviewed-on: #160 Co-authored-by: clawbot <clawbot@noreply.example.org> Co-committed-by: clawbot <clawbot@noreply.example.org>
This commit was merged in pull request #160.
This commit is contained in:
@@ -54,12 +54,18 @@ func (h *Handlers) HandleAppCreate() http.HandlerFunc { //nolint:funlen // valid
|
|||||||
repoURL := request.FormValue("repo_url")
|
repoURL := request.FormValue("repo_url")
|
||||||
branch := request.FormValue("branch")
|
branch := request.FormValue("branch")
|
||||||
dockerfilePath := request.FormValue("dockerfile_path")
|
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{
|
data := h.addGlobals(map[string]any{
|
||||||
"Name": name,
|
"Name": name,
|
||||||
"RepoURL": repoURL,
|
"RepoURL": repoURL,
|
||||||
"Branch": branch,
|
"Branch": branch,
|
||||||
"DockerfilePath": dockerfilePath,
|
"DockerfilePath": dockerfilePath,
|
||||||
|
"DockerNetwork": dockerNetwork,
|
||||||
|
"NtfyTopic": ntfyTopic,
|
||||||
|
"SlackWebhook": slackWebhook,
|
||||||
}, request)
|
}, request)
|
||||||
|
|
||||||
if name == "" || repoURL == "" {
|
if name == "" || repoURL == "" {
|
||||||
@@ -100,6 +106,9 @@ func (h *Handlers) HandleAppCreate() http.HandlerFunc { //nolint:funlen // valid
|
|||||||
RepoURL: repoURL,
|
RepoURL: repoURL,
|
||||||
Branch: branch,
|
Branch: branch,
|
||||||
DockerfilePath: dockerfilePath,
|
DockerfilePath: dockerfilePath,
|
||||||
|
DockerNetwork: dockerNetwork,
|
||||||
|
NtfyTopic: ntfyTopic,
|
||||||
|
SlackWebhook: slackWebhook,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if createErr != nil {
|
if createErr != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user