feat: db backed record removal
This commit is contained in:
parent
7db8ac69c9
commit
51b5b5cd3b
2 changed files with 11 additions and 0 deletions
2
queries/records/remove_record.sql
Normal file
2
queries/records/remove_record.sql
Normal file
|
@ -0,0 +1,2 @@
|
|||
DELETE FROM records
|
||||
WHERE cache_name = ?;
|
|
@ -48,6 +48,15 @@ async fn link_delete(
|
|||
.await
|
||||
.map_err(|err| (StatusCode::INTERNAL_SERVER_ERROR, err.to_string()))?;
|
||||
|
||||
{
|
||||
let mut conn = state.pool.acquire().await.unwrap();
|
||||
|
||||
sqlx::query_file!("queries/records/remove_record.sql", id)
|
||||
.execute(&mut *conn)
|
||||
.await
|
||||
.map_err(|err| (StatusCode::INTERNAL_SERVER_ERROR, err.to_string()))?;
|
||||
}
|
||||
|
||||
Ok(Html("".to_string()))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue