mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-02 01:01:20 +00:00
move block endpoints
This commit is contained in:
parent
f6037afa00
commit
0fa23d7b40
9 changed files with 24 additions and 21 deletions
|
@ -28,7 +28,7 @@
|
||||||
"eslint": "^9.14.0",
|
"eslint": "^9.14.0",
|
||||||
"eslint-plugin-prettier": "^5.1.3",
|
"eslint-plugin-prettier": "^5.1.3",
|
||||||
"jest": "^29.5.0",
|
"jest": "^29.5.0",
|
||||||
"lemmy-js-client": "0.20.0-api-v4.8",
|
"lemmy-js-client": "0.20.0-api-v4.10",
|
||||||
"prettier": "^3.2.5",
|
"prettier": "^3.2.5",
|
||||||
"ts-jest": "^29.1.0",
|
"ts-jest": "^29.1.0",
|
||||||
"typescript": "^5.5.4",
|
"typescript": "^5.5.4",
|
||||||
|
|
|
@ -30,8 +30,8 @@ importers:
|
||||||
specifier: ^29.5.0
|
specifier: ^29.5.0
|
||||||
version: 29.7.0(@types/node@22.9.0)
|
version: 29.7.0(@types/node@22.9.0)
|
||||||
lemmy-js-client:
|
lemmy-js-client:
|
||||||
specifier: 0.20.0-api-v4.8
|
specifier: 0.20.0-api-v4.10
|
||||||
version: 0.20.0-api-v4.8
|
version: 0.20.0-api-v4.10
|
||||||
prettier:
|
prettier:
|
||||||
specifier: ^3.2.5
|
specifier: ^3.2.5
|
||||||
version: 3.3.3
|
version: 3.3.3
|
||||||
|
@ -1167,8 +1167,8 @@ packages:
|
||||||
resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==}
|
resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==}
|
||||||
engines: {node: '>=6'}
|
engines: {node: '>=6'}
|
||||||
|
|
||||||
lemmy-js-client@0.20.0-api-v4.8:
|
lemmy-js-client@0.20.0-api-v4.10:
|
||||||
resolution: {integrity: sha512-h+qgWXP4kUrr2va//WTGT6EXDUHAf3hJpitpD9SX9avlBRyVpp31pJ5BPm1G4kR7KPPyKO/nmAS+7HGKtGkRKA==}
|
resolution: {integrity: sha512-Dtl0CuS2LSVTX02TTRW3Zu51VWUZW3cPt3he+dnfPLVAr+nRA5erGObQJH5B353IO4RTPXDV+nYl+GKHgDeLtw==}
|
||||||
|
|
||||||
leven@3.1.0:
|
leven@3.1.0:
|
||||||
resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==}
|
resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==}
|
||||||
|
@ -3077,7 +3077,7 @@ snapshots:
|
||||||
|
|
||||||
kleur@3.0.3: {}
|
kleur@3.0.3: {}
|
||||||
|
|
||||||
lemmy-js-client@0.20.0-api-v4.8: {}
|
lemmy-js-client@0.20.0-api-v4.10: {}
|
||||||
|
|
||||||
leven@3.1.0: {}
|
leven@3.1.0: {}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ use lemmy_db_views_actor::structs::CommunityView;
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
#[tracing::instrument(skip(context))]
|
||||||
pub async fn block_community(
|
pub async fn user_block_community(
|
||||||
data: Json<BlockCommunity>,
|
data: Json<BlockCommunity>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
local_user_view: LocalUserView,
|
local_user_view: LocalUserView,
|
||||||
|
|
|
@ -12,7 +12,7 @@ use lemmy_db_views_actor::structs::PersonView;
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
#[tracing::instrument(skip(context))]
|
||||||
pub async fn block_person(
|
pub async fn user_block_person(
|
||||||
data: Json<BlockPerson>,
|
data: Json<BlockPerson>,
|
||||||
context: Data<LemmyContext>,
|
context: Data<LemmyContext>,
|
||||||
local_user_view: LocalUserView,
|
local_user_view: LocalUserView,
|
||||||
|
|
|
@ -10,7 +10,7 @@ pub mod list_logins;
|
||||||
pub mod list_media;
|
pub mod list_media;
|
||||||
pub mod login;
|
pub mod login;
|
||||||
pub mod logout;
|
pub mod logout;
|
||||||
pub mod notifications;
|
pub mod notifications;pub mod user_block_instance;
|
||||||
pub mod report_count;
|
pub mod report_count;
|
||||||
pub mod reset_password;
|
pub mod reset_password;
|
||||||
pub mod save_settings;
|
pub mod save_settings;
|
||||||
|
|
|
@ -6,4 +6,3 @@ pub mod list_all_media;
|
||||||
pub mod mod_log;
|
pub mod mod_log;
|
||||||
pub mod purge;
|
pub mod purge;
|
||||||
pub mod registration_applications;
|
pub mod registration_applications;
|
||||||
pub mod user_block_instance;
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ use lemmy_api::{
|
||||||
community::{
|
community::{
|
||||||
add_mod::add_mod_to_community,
|
add_mod::add_mod_to_community,
|
||||||
ban::ban_from_community,
|
ban::ban_from_community,
|
||||||
block::block_community,
|
block::user_block_community,
|
||||||
follow::follow_community,
|
follow::follow_community,
|
||||||
hide::hide_community,
|
hide::hide_community,
|
||||||
transfer::transfer_community,
|
transfer::transfer_community,
|
||||||
|
@ -22,7 +22,7 @@ use lemmy_api::{
|
||||||
local_user::{
|
local_user::{
|
||||||
add_admin::add_admin,
|
add_admin::add_admin,
|
||||||
ban_person::ban_from_site,
|
ban_person::ban_from_site,
|
||||||
block::block_person,
|
block::user_block_person,
|
||||||
change_password::change_password,
|
change_password::change_password,
|
||||||
change_password_after_reset::change_password_after_reset,
|
change_password_after_reset::change_password_after_reset,
|
||||||
generate_totp_secret::generate_totp_secret,
|
generate_totp_secret::generate_totp_secret,
|
||||||
|
@ -44,6 +44,7 @@ use lemmy_api::{
|
||||||
reset_password::reset_password,
|
reset_password::reset_password,
|
||||||
save_settings::save_user_settings,
|
save_settings::save_user_settings,
|
||||||
update_totp::update_totp,
|
update_totp::update_totp,
|
||||||
|
user_block_instance::user_block_instance,
|
||||||
validate_auth::validate_auth,
|
validate_auth::validate_auth,
|
||||||
verify_email::verify_email,
|
verify_email::verify_email,
|
||||||
},
|
},
|
||||||
|
@ -85,7 +86,6 @@ use lemmy_api::{
|
||||||
list::list_registration_applications,
|
list::list_registration_applications,
|
||||||
unread_count::get_unread_registration_application_count,
|
unread_count::get_unread_registration_application_count,
|
||||||
},
|
},
|
||||||
user_block_instance::user_block_instance,
|
|
||||||
},
|
},
|
||||||
sitemap::get_sitemap,
|
sitemap::get_sitemap,
|
||||||
};
|
};
|
||||||
|
@ -181,7 +181,7 @@ pub fn config(cfg: &mut ServiceConfig, rate_limit: &RateLimitCell) {
|
||||||
.route("/hide", put().to(hide_community))
|
.route("/hide", put().to(hide_community))
|
||||||
.route("/list", get().to(list_communities))
|
.route("/list", get().to(list_communities))
|
||||||
.route("/follow", post().to(follow_community))
|
.route("/follow", post().to(follow_community))
|
||||||
.route("/block", post().to(block_community))
|
.route("/block", post().to(user_block_community))
|
||||||
.route("/delete", post().to(delete_community))
|
.route("/delete", post().to(delete_community))
|
||||||
// Mod Actions
|
// Mod Actions
|
||||||
.route("/remove", post().to(remove_community))
|
.route("/remove", post().to(remove_community))
|
||||||
|
@ -321,7 +321,7 @@ pub fn config(cfg: &mut ServiceConfig, rate_limit: &RateLimitCell) {
|
||||||
// Admin action. I don't like that it's in /user
|
// Admin action. I don't like that it's in /user
|
||||||
.route("/ban", post().to(ban_from_site))
|
.route("/ban", post().to(ban_from_site))
|
||||||
.route("/banned", get().to(list_banned_users))
|
.route("/banned", get().to(list_banned_users))
|
||||||
.route("/block", post().to(block_person))
|
.route("/block", post().to(user_block_person))
|
||||||
// TODO Account actions. I don't like that they're in /user maybe /accounts
|
// TODO Account actions. I don't like that they're in /user maybe /accounts
|
||||||
.route("/logout", post().to(logout))
|
.route("/logout", post().to(logout))
|
||||||
.route("/delete_account", post().to(delete_account))
|
.route("/delete_account", post().to(delete_account))
|
||||||
|
|
|
@ -14,7 +14,7 @@ use lemmy_api::{
|
||||||
community::{
|
community::{
|
||||||
add_mod::add_mod_to_community,
|
add_mod::add_mod_to_community,
|
||||||
ban::ban_from_community,
|
ban::ban_from_community,
|
||||||
block::block_community,
|
block::user_block_community,
|
||||||
follow::follow_community,
|
follow::follow_community,
|
||||||
hide::hide_community,
|
hide::hide_community,
|
||||||
pending_follows::{
|
pending_follows::{
|
||||||
|
@ -28,7 +28,7 @@ use lemmy_api::{
|
||||||
local_user::{
|
local_user::{
|
||||||
add_admin::add_admin,
|
add_admin::add_admin,
|
||||||
ban_person::ban_from_site,
|
ban_person::ban_from_site,
|
||||||
block::block_person,
|
block::user_block_person,
|
||||||
change_password::change_password,
|
change_password::change_password,
|
||||||
change_password_after_reset::change_password_after_reset,
|
change_password_after_reset::change_password_after_reset,
|
||||||
generate_totp_secret::generate_totp_secret,
|
generate_totp_secret::generate_totp_secret,
|
||||||
|
@ -50,6 +50,7 @@ use lemmy_api::{
|
||||||
reset_password::reset_password,
|
reset_password::reset_password,
|
||||||
save_settings::save_user_settings,
|
save_settings::save_user_settings,
|
||||||
update_totp::update_totp,
|
update_totp::update_totp,
|
||||||
|
user_block_instance::user_block_instance,
|
||||||
validate_auth::validate_auth,
|
validate_auth::validate_auth,
|
||||||
verify_email::verify_email,
|
verify_email::verify_email,
|
||||||
},
|
},
|
||||||
|
@ -170,7 +171,6 @@ pub fn config(cfg: &mut ServiceConfig, rate_limit: &RateLimitCell) {
|
||||||
.service(
|
.service(
|
||||||
scope("/site")
|
scope("/site")
|
||||||
.route("", get().to(get_site_v4))
|
.route("", get().to(get_site_v4))
|
||||||
// Admin Actions
|
|
||||||
.route("", post().to(create_site))
|
.route("", post().to(create_site))
|
||||||
.route("", put().to(update_site)),
|
.route("", put().to(update_site)),
|
||||||
)
|
)
|
||||||
|
@ -196,7 +196,6 @@ pub fn config(cfg: &mut ServiceConfig, rate_limit: &RateLimitCell) {
|
||||||
.route("/hide", put().to(hide_community))
|
.route("/hide", put().to(hide_community))
|
||||||
.route("/list", get().to(list_communities))
|
.route("/list", get().to(list_communities))
|
||||||
.route("/follow", post().to(follow_community))
|
.route("/follow", post().to(follow_community))
|
||||||
.route("/block", post().to(block_community))
|
|
||||||
.route("/delete", post().to(delete_community))
|
.route("/delete", post().to(delete_community))
|
||||||
// Mod Actions
|
// Mod Actions
|
||||||
.route("/remove", post().to(remove_community))
|
.route("/remove", post().to(remove_community))
|
||||||
|
@ -304,7 +303,6 @@ pub fn config(cfg: &mut ServiceConfig, rate_limit: &RateLimitCell) {
|
||||||
.route("/list_media", get().to(list_media))
|
.route("/list_media", get().to(list_media))
|
||||||
.route("/mention", get().to(list_mentions))
|
.route("/mention", get().to(list_mentions))
|
||||||
.route("/replies", get().to(list_replies))
|
.route("/replies", get().to(list_replies))
|
||||||
.route("/block", post().to(block_person))
|
|
||||||
.route("/delete", post().to(delete_account))
|
.route("/delete", post().to(delete_account))
|
||||||
.route(
|
.route(
|
||||||
"/mention/mark_as_read",
|
"/mention/mark_as_read",
|
||||||
|
@ -317,7 +315,13 @@ pub fn config(cfg: &mut ServiceConfig, rate_limit: &RateLimitCell) {
|
||||||
.route("/report_count", get().to(report_count))
|
.route("/report_count", get().to(report_count))
|
||||||
.route("/unread_count", get().to(unread_count))
|
.route("/unread_count", get().to(unread_count))
|
||||||
.route("/list_logins", get().to(list_logins))
|
.route("/list_logins", get().to(list_logins))
|
||||||
.route("/validate_auth", get().to(validate_auth)),
|
.route("/validate_auth", get().to(validate_auth))
|
||||||
|
.service(
|
||||||
|
scope("/block")
|
||||||
|
.route("/person", post().to(user_block_person))
|
||||||
|
.route("/community", post().to(user_block_community))
|
||||||
|
.route("/instance", post().to(user_block_instance)),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
// User actions
|
// User actions
|
||||||
.route("/person", get().to(read_person))
|
.route("/person", get().to(read_person))
|
||||||
|
|
Loading…
Reference in a new issue