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

Method delete_question

ch_09/src/store.rs:140–159  ·  view source on GitHub ↗
(
        self,
        id: i32,
        account_id: AccountId,
    )

Source from the content-addressed store, hash-verified

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

Callers 1

delete_questionFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected