use actix_web::*;
use lemmy_api::Perform;
-use lemmy_api_common::{comment::*, community::*, person::*, post::*, site::*, websocket::*};
+use lemmy_api_common::{
+ comment::*,
+ community::*,
+ person::*,
+ post::*,
+ private_message::*,
+ site::*,
+ websocket::*,
+};
use lemmy_api_crud::PerformCrud;
use lemmy_utils::rate_limit::RateLimit;
use lemmy_websocket::{routes::chat_route, LemmyContext};
.route("", web::get().to(route_get_crud::<GetSite>))
// Admin Actions
.route("", web::post().to(route_post_crud::<CreateSite>))
- .route("", web::put().to(route_post_crud::<EditSite>))
- .route("/transfer", web::post().to(route_post::<TransferSite>))
- .route("/config", web::get().to(route_get::<GetSiteConfig>))
- .route("/config", web::put().to(route_post::<SaveSiteConfig>)),
+ .route("", web::put().to(route_post_crud::<EditSite>)),
)
.service(
web::resource("/modlog")
)
.service(
web::resource("/search")
- .wrap(rate_limit.message())
+ .wrap(rate_limit.search())
.route(web::get().to(route_get::<Search>)),
)
.service(
.wrap(rate_limit.message())
.route("", web::get().to(route_get_crud::<GetCommunity>))
.route("", web::put().to(route_post_crud::<EditCommunity>))
+ .route("/hide", web::put().to(route_post::<HideCommunity>))
.route("/list", web::get().to(route_get_crud::<ListCommunities>))
.route("/follow", web::post().to(route_post::<FollowCommunity>))
.route("/block", web::post().to(route_post::<BlockCommunity>))
.route("/remove", web::post().to(route_post_crud::<RemoveComment>))
.route(
"/mark_as_read",
- web::post().to(route_post::<MarkCommentAsRead>),
+ web::post().to(route_post::<MarkCommentReplyAsRead>),
)
.route("/like", web::post().to(route_post::<CreateCommentLike>))
.route("/save", web::put().to(route_post::<SaveComment>))
.route(
"/mark_as_read",
web::post().to(route_post::<MarkPrivateMessageAsRead>),
+ )
+ .route(
+ "/report",
+ web::post().to(route_post::<CreatePrivateMessageReport>),
+ )
+ .route(
+ "/report/resolve",
+ web::put().to(route_post::<ResolvePrivateMessageReport>),
+ )
+ .route(
+ "/report/list",
+ web::get().to(route_get::<ListPrivateMessageReports>),
),
)
// User
)
.route(
"/password_change",
- web::post().to(route_post::<PasswordChange>),
+ web::post().to(route_post::<PasswordChangeAfterReset>),
)
// mark_all_as_read feels off being in this section as well
.route(
)
.route("/report_count", web::get().to(route_get::<GetReportCount>))
.route("/unread_count", web::get().to(route_get::<GetUnreadCount>))
- .route("/verify_email", web::post().to(route_post::<VerifyEmail>)),
+ .route("/verify_email", web::post().to(route_post::<VerifyEmail>))
+ .route("/leave_admin", web::post().to(route_post::<LeaveAdmin>)),
)
// Admin Actions
.service(
"/registration_application/approve",
web::put().to(route_post::<ApproveRegistrationApplication>),
),
+ )
+ .service(
+ web::scope("/admin/purge")
+ .wrap(rate_limit.message())
+ .route("/person", web::post().to(route_post::<PurgePerson>))
+ .route("/community", web::post().to(route_post::<PurgeCommunity>))
+ .route("/post", web::post().to(route_post::<PurgePost>))
+ .route("/comment", web::post().to(route_post::<PurgeComment>)),
),
);
}