Rewrite create_index route new path, body request and response

This commit is contained in:
Quentin de Quelen 2019-11-19 16:07:24 +01:00
parent 076e781810
commit 5527457655
2 changed files with 62 additions and 24 deletions

View file

@ -13,7 +13,9 @@ pub mod synonym;
pub fn load_routes(app: &mut tide::App<Data>) {
app.at("").nest(|router| {
router.at("/indexes").nest(|router| {
router.at("/").get(index::list_indexes);
router.at("/")
.get(index::list_indexes)
.post(index::create_index);
router.at("/search").post(search::search_multi_index);
@ -29,7 +31,6 @@ pub fn load_routes(app: &mut tide::App<Data>) {
router
.at("/")
.get(index::get_index_schema)
.post(index::create_index)
.put(index::update_schema)
.delete(index::delete_index);