aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2020-08-25 21:02:56 +0200
committerHarald Eilertsen <haraldei@anduin.net>2020-08-25 21:02:56 +0200
commit5c092e52767e62987ef0294cde1ce40905fc5199 (patch)
tree4bf2954cf70f444a1eb1b3485a197cff11971746
parent69105c122cbdb3858f940428b65ceb01100fc600 (diff)
downloadramaskrik-social-5c092e52767e62987ef0294cde1ce40905fc5199.tar.gz
ramaskrik-social-5c092e52767e62987ef0294cde1ce40905fc5199.tar.bz2
ramaskrik-social-5c092e52767e62987ef0294cde1ce40905fc5199.zip
Use relative URLs for redirects.
-rw-r--r--src/controllers/event.rs4
-rw-r--r--src/controllers/film.rs2
-rw-r--r--src/controllers/room.rs2
-rw-r--r--src/controllers/screening.rs6
4 files changed, 7 insertions, 7 deletions
diff --git a/src/controllers/event.rs b/src/controllers/event.rs
index 1b754f2..4de8740 100644
--- a/src/controllers/event.rs
+++ b/src/controllers/event.rs
@@ -45,7 +45,7 @@ pub fn index(db: db::Connection) -> Result<Template, Redirect> {
},
Err(_) => {
// Create new event if it's not already in the db.
- Err(Redirect::to("/new"))
+ Err(Redirect::to("new"))
}
}
}
@@ -64,5 +64,5 @@ pub struct NewEventForm {
#[post("/", format = "application/x-www-form-urlencoded", data = "<form>")]
pub fn create(db: db::Connection, form: Form<NewEventForm>) -> Result<Redirect, Box<dyn Error>> {
models::Event::create(&db, &form.name, &form.description)?;
- Ok(Redirect::to("/"))
+ Ok(Redirect::to(""))
}
diff --git a/src/controllers/film.rs b/src/controllers/film.rs
index 70a6042..f407a4b 100644
--- a/src/controllers/film.rs
+++ b/src/controllers/film.rs
@@ -64,5 +64,5 @@ pub struct NewFilmForm {
#[post("/", format = "application/x-www-form-urlencoded", data = "<film>")]
pub fn create_film(db: db::Connection, film: Form<NewFilmForm>) -> Result<Redirect, Box<dyn Error>> {
db.create_film(&film.title, &film.url)?;
- Ok(Redirect::to("/films"))
+ Ok(Redirect::to("films"))
}
diff --git a/src/controllers/room.rs b/src/controllers/room.rs
index 6458f86..9a4f4c2 100644
--- a/src/controllers/room.rs
+++ b/src/controllers/room.rs
@@ -63,5 +63,5 @@ pub struct NewRoomForm {
#[post("/", format = "application/x-www-form-urlencoded", data = "<room>")]
pub fn create_room(db: db::Connection, room: Form<NewRoomForm>) -> Result<Redirect, Box<dyn Error>> {
db.create_room(&room.name)?;
- Ok(Redirect::to("/rooms"))
+ Ok(Redirect::to("rooms"))
}
diff --git a/src/controllers/screening.rs b/src/controllers/screening.rs
index cf7d1b1..06b0b84 100644
--- a/src/controllers/screening.rs
+++ b/src/controllers/screening.rs
@@ -93,7 +93,7 @@ pub fn create_screening(db: db::Connection, screening: Form<NewScreeningForm>) -
start_time,
end_time)?;
- Ok(Redirect::to("/screenings"))
+ Ok(Redirect::to("screenings"))
}
#[get("/<id>")]
@@ -140,7 +140,7 @@ pub fn update(db: db::Connection, screening: Form<EditScreeningForm>) -> Result<
start_time,
end_time)?;
- Ok(Redirect::to("/screenings"))
+ Ok(Redirect::to("screenings"))
}
#[derive(FromForm)]
@@ -151,5 +151,5 @@ pub struct DeleteScreeningForm {
#[delete("/", format = "application/x-www-form-urlencoded", data = "<screening>")]
pub fn delete(db: db::Connection, screening: Form<DeleteScreeningForm>) -> Result<Redirect, Box<dyn Error>> {
db.delete_screening(screening.screening_id)?;
- Ok(Redirect::to("/screenings"))
+ Ok(Redirect::to("screenings"))
}