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

Method delete_question

ch_10/src/store.rs:137–156  ·  view source on GitHub ↗
(
        self,
        id: i32,
        account_id: AccountId,
    )

Source from the content-addressed store, hash-verified

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

Callers 1

delete_questionFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected