Remove donation dialog param "hide permanently" (#5591)

This commit is contained in:
Nutomic 2025-04-03 23:16:22 +00:00 committed by GitHub
parent ba4c9a0c8f
commit a91a953f1b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 18 deletions

View file

@ -1,6 +1,6 @@
use actix_web::web::{Data, Json};
use chrono::{DateTime, Utc};
use lemmy_api_common::{context::LemmyContext, person::DonationDialogShown, SuccessResponse};
use chrono::Utc;
use lemmy_api_common::{context::LemmyContext, SuccessResponse};
use lemmy_db_schema::source::local_user::{LocalUser, LocalUserUpdateForm};
use lemmy_db_views::structs::LocalUserView;
use lemmy_utils::error::LemmyResult;
@ -8,15 +8,9 @@ use lemmy_utils::error::LemmyResult;
pub async fn donation_dialog_shown(
context: Data<LemmyContext>,
local_user_view: LocalUserView,
data: Json<DonationDialogShown>,
) -> LemmyResult<Json<SuccessResponse>> {
let last = if data.hide_permanently.unwrap_or_default() {
DateTime::<Utc>::MAX_UTC
} else {
Utc::now()
};
let form = LocalUserUpdateForm {
last_donation_notification: Some(last),
last_donation_notification: Some(Utc::now()),
..Default::default()
};
LocalUser::update(&mut context.pool(), local_user_view.local_user.id, &form).await?;

View file

@ -567,12 +567,3 @@ pub struct ListLoginsResponse {
pub struct ResendVerificationEmail {
pub email: SensitiveString,
}
#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "full", derive(TS))]
#[cfg_attr(feature = "full", ts(export))]
/// Make a request to resend your verification email.
pub struct DonationDialogShown {
#[cfg_attr(feature = "full", ts(optional))]
pub hide_permanently: Option<bool>,
}