I THINK THIS IS IT
This commit is contained in:
		
							parent
							
								
									5221bd6aea
								
							
						
					
					
						commit
						5a95045a9e
					
				| 
						 | 
				
			
			@ -22,6 +22,7 @@ impl Post {
 | 
			
		|||
        let posted_on = chrono::Utc::now().timestamp_millis();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        sqlx::query(r#"
 | 
			
		||||
            INSERT INTO posts ( id, title, descr, img_url, origin_url, original_request, posted_on )
 | 
			
		||||
            VALUES ( $1, $2, $3, $4, $5, $6, $7 )
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,6 +8,11 @@ use super::types::ReleaseEvent;
 | 
			
		|||
 | 
			
		||||
pub async fn release_handler(db: Data<Mutex<Database>>, token: Token, body: ReleaseEvent, raw_body: String) -> Result<HttpResponseBuilder> {
 | 
			
		||||
 | 
			
		||||
    if body.action != "released" {
 | 
			
		||||
        return Ok(HttpResponse::Ok());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    let title = format!("(New release {}:{}) {}", body.repository.full_name, body.release.tag_name, body.release.name.unwrap_or("No title provided".into()));
 | 
			
		||||
    let origin_url = body.repository.html_url.clone();
 | 
			
		||||
    let descr = body.release.body.unwrap_or("No body provided".into());
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user