+ Adding /neighbor/remove route api code and db-lib code
This patch has not yet been tested but will be in the coming patches Sumamary: we're just doing a regular delete on the neighbor's table based off the url field
This commit is contained in:
@@ -73,3 +73,10 @@ pub async fn update(p: &Pool, url: &str, new: Neighbor) -> SqlResult<()> {
|
||||
conn.exec_drop(q, sqlparams).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn remove(p: &Pool, url: &str) -> SqlResult<()> {
|
||||
let mut conn = p.get_conn().await?;
|
||||
let q = "DELETE FROM neighbors WHERE url = :url";
|
||||
conn.exec_drop(q, params!{"url" => url}).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user