From cba80815797b6578ab817b99fee35575cccef27d Mon Sep 17 00:00:00 2001 From: Felix Date: Thu, 16 Jan 2020 16:47:38 +0100 Subject: [PATCH] fix formatting --- server/src/routes/api.rs | 196 ++++++++------------------------------- 1 file changed, 40 insertions(+), 156 deletions(-) diff --git a/server/src/routes/api.rs b/server/src/routes/api.rs index 70e686883..b7fb773fa 100644 --- a/server/src/routes/api.rs +++ b/server/src/routes/api.rs @@ -12,164 +12,48 @@ use serde::Serialize; type DbParam = web::Data>>; +#[rustfmt::skip] pub fn config(cfg: &mut web::ServiceConfig) { cfg - .route( - "/api/v1/login", - web::post().to(route::), - ) - .route( - "/api/v1/register", - web::post().to(route::), - ) - .route( - "/api/v1/create_community", - web::post().to(route::), - ) - .route( - "/api/v1/create_post", - web::post().to(route::), - ) - .route( - "/api/v1/list_communities", - web::get().to(route::), - ) - .route( - "/api/v1/list_categories", - web::get().to(route::), - ) - .route( - "/api/v1/get_post", - web::get().to(route::), - ) - .route( - "/api/v1/get_community", - web::get().to(route::), - ) - .route( - "/api/v1/create_communent", - web::post().to(route::), - ) - .route( - "/api/v1/edit_comment", - web::post().to(route::), - ) - .route( - "/api/v1/save_comment", - web::post().to(route::), - ) - .route( - "/api/v1/create_comment_like", - web::post().to(route::), - ) - .route( - "/api/v1/get_posts", - web::get().to(route::), - ) - .route( - "/api/v1/create_post_like", - web::post().to(route::), - ) - .route( - "/api/v1/edit_post", - web::post().to(route::), - ) - .route( - "/api/v1/save_post", - web::post().to(route::), - ) - .route( - "/api/v1/edit_community", - web::post().to(route::), - ) - .route( - "/api/v1/follow_community", - web::post().to(route::), - ) - .route( - "/api/v1/get_followed_communities", - web::get().to(route::), - ) - .route( - "/api/v1/get_user_details", - web::get().to(route::), - ) - .route( - "/api/v1/get_replies", - web::get().to(route::), - ) - .route( - "/api/v1/get_user_mentions", - web::get().to(route::), - ) - .route( - "/api/v1/edit_user_mention", - web::post().to(route::), - ) - .route( - "/api/v1/get_modlog", - web::get().to(route::), - ) - .route( - "/api/v1/ban_from_community", - web::post().to(route::), - ) - .route( - "/api/v1/add_mod_to_community", - web::post().to(route::), - ) - .route( - "/api/v1/create_site", - web::post().to(route::), - ) - .route( - "/api/v1/edit_site", - web::post().to(route::), - ) - .route( - "/api/v1/get_site", - web::get().to(route::), - ) - .route( - "/api/v1/add_admin", - web::post().to(route::), - ) - .route( - "/api/v1/ban_user", - web::post().to(route::), - ) - .route( - "/api/v1/search", - web::post().to(route::), - ) - .route( - "/api/v1/mark_all_as_read", - web::post().to(route::), - ) - .route( - "/api/v1/save_user_settings", - web::post().to(route::), - ) - .route( - "/api/v1/transfer_community", - web::post().to(route::), - ) - .route( - "/api/v1/transfer_site", - web::post().to(route::), - ) - .route( - "/api/v1/delete_account", - web::post().to(route::), - ) - .route( - "/api/v1/password_reset", - web::post().to(route::), - ) - .route( - "/api/v1/password_change", - web::post().to(route::), - ); + .route("/api/v1/login", web::post().to(route::)) + .route("/api/v1/register", web::post().to(route::)) + .route("/api/v1/create_community", web::post().to(route::)) + .route("/api/v1/create_post", web::post().to(route::)) + .route("/api/v1/list_communities", web::get().to(route::)) + .route("/api/v1/list_categories", web::get().to(route::)) + .route("/api/v1/get_post", web::get().to(route::)) + .route("/api/v1/get_community", web::get().to(route::)) + .route("/api/v1/create_communent", web::post().to(route::)) + .route("/api/v1/edit_comment", web::post().to(route::)) + .route("/api/v1/save_comment", web::post().to(route::)) + .route("/api/v1/create_comment_like", web::post().to(route::)) + .route("/api/v1/get_posts", web::get().to(route::)) + .route("/api/v1/create_post_like", web::post().to(route::)) + .route("/api/v1/edit_post", web::post().to(route::)) + .route("/api/v1/save_post", web::post().to(route::)) + .route("/api/v1/edit_community", web::post().to(route::)) + .route("/api/v1/follow_community", web::post().to(route::)) + .route("/api/v1/get_followed_communities", web::get().to(route::)) + .route("/api/v1/get_user_details", web::get().to(route::)) + .route("/api/v1/get_replies", web::get().to(route::)) + .route("/api/v1/get_user_mentions", web::get().to(route::)) + .route("/api/v1/edit_user_mention", web::post().to(route::)) + .route("/api/v1/get_modlog", web::get().to(route::)) + .route("/api/v1/ban_from_community", web::post().to(route::)) + .route("/api/v1/add_mod_to_community", web::post().to(route::)) + .route("/api/v1/create_site", web::post().to(route::)) + .route("/api/v1/edit_site", web::post().to(route::)) + .route("/api/v1/get_site", web::get().to(route::)) + .route("/api/v1/add_admin", web::post().to(route::)) + .route("/api/v1/ban_user", web::post().to(route::)) + .route("/api/v1/search", web::post().to(route::)) + .route("/api/v1/mark_all_as_read", web::post().to(route::)) + .route("/api/v1/save_user_settings", web::post().to(route::)) + .route("/api/v1/transfer_community", web::post().to(route::)) + .route("/api/v1/transfer_site", web::post().to(route::)) + .route("/api/v1/delete_account", web::post().to(route::)) + .route("/api/v1/password_reset", web::post().to(route::)) + .route("/api/v1/password_change", web::post().to(route::)); } fn perform(data: Request, db: DbParam) -> Result