Adding query to update status of scheduled message

This commit is contained in:
2026-06-19 16:21:58 -04:00
parent cfc8897ca5
commit c9e66e228d
+21
View File
@@ -84,6 +84,27 @@ pub async fn get_with_user_id(
}
}
pub async fn update_status(
pool: &sqlx::PgPool,
id: &uuid::Uuid,
status: &str,
) -> Result<(), sqlx::Error> {
match sqlx::query(
r#"
UPDATE "scheduled_message" SET status = $1 WHERE id = $2;
"#,
)
.bind(status)
.bind(id)
.execute(pool)
.await {
Ok(_row) => {
Ok(())
}
Err(err) => Err(err)
}
}
async fn parse_row(
row: &sqlx::postgres::PgRow,
) -> Result<textsender_models::message::scheduling::ScheduledMessage, sqlx::Error> {