MCPcopy Create free account
hub / github.com/Rust-Web-Development/code / delete_question

Method delete_question

ch_11/src/store.rs:135–148  ·  view source on GitHub ↗
(self, id: i32, account_id: AccountId)

Source from the content-addressed store, hash-verified

133 }
134
135 pub async fn delete_question(self, id: i32, account_id: AccountId) -> Result<bool, Error> {
136 match sqlx::query("DELETE FROM questions WHERE id = $1 AND account_id = $2")
137 .bind(id)
138 .bind(account_id.0)
139 .execute(&self.connection)
140 .await
141 {
142 Ok(_) => Ok(true),
143 Err(e) => {
144 tracing::event!(tracing::Level::ERROR, "{:?}", e);
145 Err(Error::DatabaseQueryError(e))
146 }
147 }
148 }
149
150 pub async fn add_answer(self, answer: Answer, account_id: AccountId) -> Result<bool, Error> {
151 match sqlx::query(

Callers 1

delete_questionFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected