fix ci; clean code
This commit is contained in:
		@@ -34,7 +34,7 @@ CREATE TABLE IF NOT EXISTS "planned_event" (
 | 
				
			|||||||
	"name" text NOT NULL,
 | 
						"name" text NOT NULL,
 | 
				
			||||||
	"planned_amount_cox" INTEGER unsigned NOT NULL,
 | 
						"planned_amount_cox" INTEGER unsigned NOT NULL,
 | 
				
			||||||
	"trip_details_id" INTEGER NOT NULL REFERENCES TRIP_details(id) ON DELETE CASCADE,
 | 
						"trip_details_id" INTEGER NOT NULL REFERENCES TRIP_details(id) ON DELETE CASCADE,
 | 
				
			||||||
	"created_at" text NOT NULL DEFAULT CURRENT_TIMESTAMP,
 | 
						"created_at" text NOT NULL DEFAULT CURRENT_TIMESTAMP
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CREATE TABLE IF NOT EXISTS "trip" (
 | 
					CREATE TABLE IF NOT EXISTS "trip" (
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -206,12 +206,7 @@ async fn home(
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#[get("/<logbook_id>/delete")]
 | 
					#[get("/<logbook_id>/delete")]
 | 
				
			||||||
async fn delete(
 | 
					async fn delete(db: &State<SqlitePool>, logbook_id: i32, _adminuser: AdminUser) -> Flash<Redirect> {
 | 
				
			||||||
    db: &State<SqlitePool>,
 | 
					 | 
				
			||||||
    flash: Option<FlashMessage<'_>>,
 | 
					 | 
				
			||||||
    logbook_id: i32,
 | 
					 | 
				
			||||||
    _adminuser: AdminUser,
 | 
					 | 
				
			||||||
) -> Flash<Redirect> {
 | 
					 | 
				
			||||||
    let logbook = Logbook::find_by_id(db, logbook_id).await;
 | 
					    let logbook = Logbook::find_by_id(db, logbook_id).await;
 | 
				
			||||||
    if let Some(logbook) = logbook {
 | 
					    if let Some(logbook) = logbook {
 | 
				
			||||||
        logbook.delete(db).await;
 | 
					        logbook.delete(db).await;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user