From c712cabb72dbf53844f61ff31dadde617b18e644 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Mon, 14 Nov 2022 14:48:54 -0500 Subject: [PATCH] rsvp: Update success page edit link to go to form There's a bit of a hack here where if the second person in the party hits the edit link, it might have the first person's name, but hopefully people won't mind / notice. Also this breaks the "maybe we should make the edit page a POST request so that it's not linkable" TODO... but that's an issue for later. --- src/handler.scm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/handler.scm b/src/handler.scm index 6b22028..d4769d4 100644 --- a/src/handler.scm +++ b/src/handler.scm @@ -139,12 +139,15 @@ (begin ;; This will raise if update-guest fails (so we get an error page) (map update-guest (map cdr guests)) - (send-sxml - (template-page - `((h2 "RSVP") - (p "Success! Thanks for RSVP-ing.") - (p (a (@ (href "/")) "Edit your response")) - (p (a (@ (href "https://jennex.org")) "Read more about the event")))))) + (let* ((first-guest (cdadr guests)) + (first-name (guest-name first-guest)) + (edit-link (conc "/rsvp?rsvp-name=" (uri-encode-string first-name)))) + (send-sxml + (template-page + `((h2 "RSVP") + (p "Success! Thanks for RSVP-ing.") + (p (a (@ (href ,edit-link))) "Edit your response") + (p (a (@ (href "https://jennex.org")) "Read more about the event"))))))) (let* ((input (car fdata)) (name (car input)) (value (cdr input)) -- libgit2 1.1.1