forked from Ruderverein-Donau-Linz/rowt
		
	Merge pull request 'maybe unpublishing a post works now?' (#683) from fix into main
Reviewed-on: Ruderverein-Donau-Linz/rowt#683
This commit is contained in:
		@@ -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) {
 | 
			
		||||
        let link = Some(link);
 | 
			
		||||
        sqlx::query!("DELETE FROM notification WHERE link=?", link)
 | 
			
		||||
            .execute(db)
 | 
			
		||||
            .await
 | 
			
		||||
 
 | 
			
		||||
@@ -161,7 +161,11 @@ async fn blogpost_unpublished(
 | 
			
		||||
    config: &State<Config>,
 | 
			
		||||
) -> String {
 | 
			
		||||
    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()
 | 
			
		||||
    } else {
 | 
			
		||||
        "WRONG pw".into()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user