mirror of
https://github.com/LemmyNet/lemmy.git
synced 2025-09-03 19:53:48 +00:00
Remove donation dialog param "hide permanently" (#5591)
This commit is contained in:
parent
ba4c9a0c8f
commit
a91a953f1b
2 changed files with 3 additions and 18 deletions
|
@ -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?;
|
||||
|
|
|
@ -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>,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue