Your one-stop-cake-shop for everything Freshly Baked has to offer

fix(m): correct links on regex deletion page #192

closed opened by a.starrysky.fyi targeting main from private/minion/push-rvvlvvqouvzu

With regex, we're not linking to the start/end shortlinks as they are not necessarily valid links. We missed changing these to codeblocks on the deletion page, so let's do that now...

Labels

None yet.

requested-reviewers

None yet.

approved

None yet.

tested-working

None yet.

rejected

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:uuyqs6y3pwtbteet4swt5i5y/sh.tangled.repo.pull/3mdjm43jt6x22
+29 -3
Diff #0
+21 -1
menu/src/main.rs
··· 191 191 Query(params): Query<HashMap<String, String>>, 192 192 headers: HeaderMap, 193 193 ) -> Result<Html<String>> { 194 - handle_static_page(StaticPageType::DeleteSuccess, session, &params, &headers).await 194 + match params.get("format").and_then(|s| Some(s.as_str())) { 195 + Some("direct") => { 196 + handle_static_page( 197 + StaticPageType::DeleteDirectSuccess, 198 + session, 199 + &params, 200 + &headers, 201 + ) 202 + .await 203 + } 204 + Some("regex") => { 205 + handle_static_page( 206 + StaticPageType::DeleteRegexSuccess, 207 + session, 208 + &params, 209 + &headers, 210 + ) 211 + .await 212 + } 213 + _ => Err("Invalid format".into()), 214 + } 195 215 } 196 216 async fn handle_delete_failure_page( 197 217 session: Session,
+8 -2
menu/src/static_html.rs
··· 46 46 CreateDirectSuccess, 47 47 CreateRegexSuccess, 48 48 DeleteFailure, 49 - DeleteSuccess, 49 + DeleteDirectSuccess, 50 + DeleteRegexSuccess, 50 51 Index, 51 52 } 52 53 ··· 76 77 include_String_dynamic!("./html/create/success/regex.html") 77 78 } 78 79 StaticPageType::DeleteFailure => include_String_dynamic!("./html/delete/failure.html"), 79 - StaticPageType::DeleteSuccess => include_String_dynamic!("./html/delete/success.html"), 80 + StaticPageType::DeleteDirectSuccess => { 81 + include_String_dynamic!("./html/delete/success/direct.html") 82 + } 83 + StaticPageType::DeleteRegexSuccess => { 84 + include_String_dynamic!("./html/delete/success/regex.html") 85 + } 80 86 StaticPageType::Index => include_String_dynamic!("./html/index.html"), 81 87 }; 82 88

History

1 round 0 comments
sign up or login to add to the discussion
a.starrysky.fyi submitted #0
1 commit
expand
fix(m): correct links on regex deletion page
1/5 failed, 4/5 success
expand
expand 0 comments
closed without merging