add: post drafts
fix: allow question sender to view question
This commit is contained in:
parent
24162573ee
commit
f6cbeb9bd8
22 changed files with 642 additions and 100 deletions
|
@ -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)]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue