added ded simple delete interface for channels
This commit is contained in:
parent
e616a160fa
commit
5950f3b505
@ -64,6 +64,15 @@ impl FromDB<Channel> for Channel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn delete(p: &Pool, id: UBigInt) -> Response<Channel> {
|
async fn delete(p: &Pool, id: UBigInt) -> Response<Channel> {
|
||||||
unimplemented!()
|
if let Ok(conn) = p.get_conn().await {
|
||||||
|
let q = "DELETE FROM channels WHERE id = :id";
|
||||||
|
let result: Result<Conn, SqlError> =
|
||||||
|
conn.drop_exec(q, params!{"id" => id}).await;
|
||||||
|
return match result {
|
||||||
|
Ok(_) => Response::Success,
|
||||||
|
Err(_) => Response::Other(sql_err!("Member::FromDB::delete Listen i dont know either"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Response::Other(no_conn!("Member::FromDB::delete"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user