Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into axum_7
Browse files Browse the repository at this point in the history
  • Loading branch information
dgsantana committed Dec 13, 2023
2 parents 415d821 + b578ec8 commit 265d97e
Show file tree
Hide file tree
Showing 9 changed files with 176 additions and 165 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ are a few guidelines that will make it a better experience for everyone:
- If it’s an unsolicited PR not linked to an open issue, please include a
specific explanation for what it’s trying to achieve. For example: “When I
was trying to deploy my app under _circumstances X_, I found that the way
_function Z_ was implemented caused _issue Z_. This PR should fix that by
_function Y_ was implemented caused _issue Z_. This PR should fix that by
_solution._
- Our CI tests every PR against all the existing examples, sometimes requiring
compilation for both server and client side, etc. It’s thorough but slow. If
Expand Down
1 change: 1 addition & 0 deletions examples/session_auth_axum/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DATABASE_URL=sqlite://Todos.db
33 changes: 16 additions & 17 deletions examples/session_auth_axum/src/error_template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,21 @@ pub fn ErrorTemplate(
}

view! {
<h1>"Errors"</h1>
<For
// a function that returns the items we're iterating over; a signal is fine
each= move || {errors.clone().into_iter().enumerate()}
// a unique key for each item as a reference
key=|(index, _error)| *index
// renders each item to a view
children=move |error| {
let error_string = error.1.to_string();
let error_code= error.1.status_code();
view! {

<h2>{error_code.to_string()}</h2>
<p>"Error: " {error_string}</p>
}
}
/>
<h1>"Errors"</h1>
<For
// a function that returns the items we're iterating over; a signal is fine
each=move || { errors.clone().into_iter().enumerate() }
// a unique key for each item as a reference
key=|(index, _error)| *index
// renders each item to a view
children=move |error| {
let error_string = error.1.to_string();
let error_code = error.1.status_code();
view! {
<h2>{error_code.to_string()}</h2>
<p>"Error: " {error_string}</p>
}
}
/>
}
}
Loading

0 comments on commit 265d97e

Please sign in to comment.