-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a074624
commit 4f3f2d4
Showing
28 changed files
with
95 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,5 @@ pub mod responses; | |
pub mod upload; | ||
pub mod user; | ||
pub mod view_engine; | ||
|
||
pub mod pages; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#![allow(clippy::missing_errors_doc)] | ||
#![allow(clippy::unnecessary_struct_initialization)] | ||
#![allow(clippy::unused_async)] | ||
use axum::debug_handler; | ||
use loco_rs::prelude::*; | ||
|
||
#[debug_handler] | ||
pub async fn about( | ||
ViewEngine(v): ViewEngine<TeraView>, | ||
State(_ctx): State<AppContext>, | ||
) -> Result<Response> { | ||
format::render().view(&v, "pages/about.html", data!({})) | ||
} | ||
|
||
pub fn routes() -> Routes { | ||
Routes::new().prefix("pages").add("about", get(about)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
mod roles; | ||
mod users; | ||
mod users_roles; | ||
|
||
mod cars; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,7 @@ async fn handle_create_with_password_with_duplicate() { | |
configure_insta!(); | ||
|
||
let boot = boot_test::<App>().await.unwrap(); | ||
seed::<App>(&boot.app_context.db).await.unwrap(); | ||
seed::<App>(&boot.app_context).await.unwrap(); | ||
|
||
let new_user: Result<Model, ModelError> = Model::create_with_password( | ||
&boot.app_context.db, | ||
|
@@ -81,7 +81,7 @@ async fn can_find_by_email() { | |
configure_insta!(); | ||
|
||
let boot = boot_test::<App>().await.unwrap(); | ||
seed::<App>(&boot.app_context.db).await.unwrap(); | ||
seed::<App>(&boot.app_context).await.unwrap(); | ||
|
||
let existing_user = Model::find_by_email(&boot.app_context.db, "[email protected]").await; | ||
let non_existing_user_results = | ||
|
@@ -97,7 +97,7 @@ async fn can_find_by_pid() { | |
configure_insta!(); | ||
|
||
let boot = boot_test::<App>().await.unwrap(); | ||
seed::<App>(&boot.app_context.db).await.unwrap(); | ||
seed::<App>(&boot.app_context).await.unwrap(); | ||
|
||
let existing_user = | ||
Model::find_by_pid(&boot.app_context.db, "11111111-1111-1111-1111-111111111111").await; | ||
|
@@ -114,7 +114,7 @@ async fn can_verification_token() { | |
configure_insta!(); | ||
|
||
let boot = boot_test::<App>().await.unwrap(); | ||
seed::<App>(&boot.app_context.db).await.unwrap(); | ||
seed::<App>(&boot.app_context).await.unwrap(); | ||
|
||
let user = Model::find_by_pid(&boot.app_context.db, "11111111-1111-1111-1111-111111111111") | ||
.await | ||
|
@@ -143,7 +143,7 @@ async fn can_set_forgot_password_sent() { | |
configure_insta!(); | ||
|
||
let boot = boot_test::<App>().await.unwrap(); | ||
seed::<App>(&boot.app_context.db).await.unwrap(); | ||
seed::<App>(&boot.app_context).await.unwrap(); | ||
|
||
let user = Model::find_by_pid(&boot.app_context.db, "11111111-1111-1111-1111-111111111111") | ||
.await | ||
|
@@ -172,7 +172,7 @@ async fn can_verified() { | |
configure_insta!(); | ||
|
||
let boot = boot_test::<App>().await.unwrap(); | ||
seed::<App>(&boot.app_context.db).await.unwrap(); | ||
seed::<App>(&boot.app_context).await.unwrap(); | ||
|
||
let user = Model::find_by_pid(&boot.app_context.db, "11111111-1111-1111-1111-111111111111") | ||
.await | ||
|
@@ -199,7 +199,7 @@ async fn can_reset_password() { | |
configure_insta!(); | ||
|
||
let boot = boot_test::<App>().await.unwrap(); | ||
seed::<App>(&boot.app_context.db).await.unwrap(); | ||
seed::<App>(&boot.app_context).await.unwrap(); | ||
|
||
let user = Model::find_by_pid(&boot.app_context.db, "11111111-1111-1111-1111-111111111111") | ||
.await | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.