Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rocket version #384

Merged
merged 2 commits into from
Dec 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/rocket_example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ async-stream = { version = "^0.3" }
async-trait = { version = "0.1" }
futures = { version = "^0.3" }
futures-util = { version = "^0.3" }
rocket = { git = "https://github.com/SergioBenitez/Rocket.git", features = [
rocket = { version = "0.5.0-rc.1", features = [
"json",
] }
rocket_dyn_templates = { git = "https://github.com/SergioBenitez/Rocket.git", features = [
rocket_dyn_templates = { version = "0.1.0-rc.1", features = [
"tera",
] }
serde_json = { version = "^1" }
Expand Down
29 changes: 15 additions & 14 deletions examples/rocket_example/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ use rocket::fs::{relative, FileServer};
use rocket::request::FlashMessage;
use rocket::response::{Flash, Redirect};
use rocket::{Build, Request, Rocket};
use rocket_dyn_templates::{context, Template};
use rocket_dyn_templates::Template;
use serde_json::json;

use sea_orm::{entity::*, query::*};
use sea_orm_rocket::{Connection, Database};
Expand Down Expand Up @@ -107,13 +108,13 @@ async fn list(

Template::render(
"index",
context! {
page: page,
posts_per_page: posts_per_page,
num_pages: num_pages,
posts: posts,
flash: flash.map(FlashMessage::into_inner),
},
json! ({
"page": page,
"posts_per_page": posts_per_page,
"num_pages": num_pages,
"posts": posts,
"flash": flash.map(FlashMessage::into_inner),
})
)
}

Expand All @@ -128,9 +129,9 @@ async fn edit(conn: Connection<'_, Db>, id: i32) -> Template {

Template::render(
"edit",
context! {
post: post,
},
json! ({
"post": post,
})
)
}

Expand All @@ -157,9 +158,9 @@ async fn destroy(conn: Connection<'_, Db>) -> Result<(), rocket::response::Debug
pub fn not_found(req: &Request<'_>) -> Template {
Template::render(
"error/404",
context! {
uri: req.uri()
},
json! ({
"uri": req.uri()
})
)
}

Expand Down
2 changes: 1 addition & 1 deletion sea-orm-rocket/codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ devise = "0.3"
quote = "1"

[dev-dependencies]
rocket = { git = "https://github.com/SergioBenitez/Rocket.git", default-features = false }
rocket = { version = "0.5.0-rc.1", default-features = false }
trybuild = "1.0"
version_check = "0.9"
3 changes: 1 addition & 2 deletions sea-orm-rocket/lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ edition = "2021"
all-features = true

[dependencies.rocket]
git = "https://github.com/SergioBenitez/Rocket.git"
version = "0.5.0-rc.1"
default-features = false

Expand All @@ -22,6 +21,6 @@ path = "../codegen"
version = "0.1.0-rc"

[dev-dependencies.rocket]
git = "https://github.com/SergioBenitez/Rocket.git"
version = "0.5.0-rc.1"
default-features = false
features = ["json"]