Method
delete_question
(
&self,
question_id: i32,
)
Source from the content-addressed store, hash-verified
| 115 | } |
| 116 | |
| 117 | pub async fn delete_question( |
| 118 | &self, |
| 119 | question_id: i32, |
| 120 | ) -> Result<bool, Error> { |
| 121 | match sqlx::query("DELETE FROM questions WHERE id = $1") |
| 122 | .bind(question_id) |
| 123 | .execute(&self.connection) |
| 124 | .await |
| 125 | { |
| 126 | Ok(_) => Ok(true), |
| 127 | Err(e) => { |
| 128 | tracing::event!(tracing::Level::ERROR, "{:?}", e); |
| 129 | Err(Error::DatabaseQueryError) |
| 130 | } |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | pub async fn add_answer( |
| 135 | &self, |
Tested by
no test coverage detected