truths: Change truth creation URL

As we will be able to create a new week, <week>/new to <week>/new_truth to
differentiate it from the week creation URL.
This commit is contained in:
trotFunky 2024-07-25 16:54:19 +01:00
parent f74ed20e80
commit f7e1218f21
2 changed files with 2 additions and 2 deletions

View file

@ -53,7 +53,7 @@ pub async fn edit_truth(week: u8, truth_number: u8, form: Form<TruthUpdateForm>,
Redirect::to(uri!("/")) Redirect::to(uri!("/"))
} }
#[post("/<week>/new", data="<form>")] #[post("/<week>/new_truth", data="<form>")]
pub async fn create_truth(week: u8, form: Form<TruthUpdateForm>, pub async fn create_truth(week: u8, form: Form<TruthUpdateForm>,
mut db: Connection<database::Db>, cookies: &CookieJar<'_>) -> Redirect { mut db: Connection<database::Db>, cookies: &CookieJar<'_>) -> Redirect {
let user = auth::get_user(week, &mut db, cookies).await; let user = auth::get_user(week, &mut db, cookies).await;

View file

@ -91,7 +91,7 @@
{% if user.is_admin == true %} {% if user.is_admin == true %}
<div class="individual_truth"> <div class="individual_truth">
<h3>Nouvelle vérité</h3> <h3>Nouvelle vérité</h3>
<form action="/{{ week_data.number }}/new" method="POST"> <form action="/{{ week_data.number }}/new_truth" method="POST">
{% include "truth_editor" %} {% include "truth_editor" %}
</form> </form>
</div> </div>