Rename the lists index handler for consistency
This commit is contained in:
parent
51d3e876d6
commit
c2baff37f3
|
@ -40,7 +40,7 @@ fn index(lists: State<ListStore>) -> Template {
|
|||
}
|
||||
|
||||
#[get("/lists", format = "application/json")]
|
||||
fn lists(lists: State<ListStore>) -> Option<Json<Vec<List>>> {
|
||||
fn list_index(lists: State<ListStore>) -> Option<Json<Vec<List>>> {
|
||||
let lists = lists.read().unwrap();
|
||||
Some(Json(lists.clone()))
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ fn rocket() -> Rocket {
|
|||
let lists = list::List::load_all();
|
||||
rocket::ignite()
|
||||
.manage(RwLock::new(lists))
|
||||
.mount("/", routes![index, lists, list_show_html, list_show_json, list_update, static_files::all])
|
||||
.mount("/", routes![index, list_index, list_show_html, list_show_json, list_update, static_files::all])
|
||||
.attach(Template::fairing())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue