add: post drafts

fix: allow question sender to view question
This commit is contained in:
trisua 2025-05-17 19:57:09 -04:00
parent 24162573ee
commit f6cbeb9bd8
22 changed files with 642 additions and 100 deletions

View file

@ -291,6 +291,28 @@ impl DataManager {
return Err(Error::DatabaseError(e.to_string()));
}
// delete stacks
let res = execute!(
&conn,
"DELETE FROM stacks WHERE owner = $1",
&[&(id as i64)]
);
if let Err(e) = res {
return Err(Error::DatabaseError(e.to_string()));
}
// delete drafts
let res = execute!(
&conn,
"DELETE FROM drafts WHERE owner = $1",
&[&(id as i64)]
);
if let Err(e) = res {
return Err(Error::DatabaseError(e.to_string()));
}
// delete posts
let res = execute!(&conn, "DELETE FROM posts WHERE owner = $1", &[&(id as i64)]);