Compare commits
2 Commits
bfee85a963
...
c41dc0853a
Author | SHA1 | Date | |
---|---|---|---|
c41dc0853a | |||
cc7bd3a416 |
@ -181,6 +181,7 @@ ORDER BY read_at DESC, created_at DESC;
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) async fn delete_by_link(db: &sqlx::Pool<Sqlite>, link: &str) {
|
pub(crate) async fn delete_by_link(db: &sqlx::Pool<Sqlite>, link: &str) {
|
||||||
|
let link = Some(link);
|
||||||
sqlx::query!("DELETE FROM notification WHERE link=?", link)
|
sqlx::query!("DELETE FROM notification WHERE link=?", link)
|
||||||
.execute(db)
|
.execute(db)
|
||||||
.await
|
.await
|
||||||
|
@ -161,7 +161,11 @@ async fn blogpost_unpublished(
|
|||||||
config: &State<Config>,
|
config: &State<Config>,
|
||||||
) -> String {
|
) -> String {
|
||||||
if blogpost.pw == &config.wordpress_key {
|
if blogpost.pw == &config.wordpress_key {
|
||||||
Notification::delete_by_link(&db, blogpost.article_url).await;
|
Notification::delete_by_link(
|
||||||
|
&db,
|
||||||
|
&urlencoding::decode(blogpost.article_url).expect("UTF-8"),
|
||||||
|
)
|
||||||
|
.await;
|
||||||
"ACK".into()
|
"ACK".into()
|
||||||
} else {
|
} else {
|
||||||
"WRONG pw".into()
|
"WRONG pw".into()
|
||||||
|
Loading…
Reference in New Issue
Block a user