Skip to content

Commit 949e751

Browse files
committed
Merge branch 'main' into 241-external-api-endpoints
2 parents c218e7b + 8757c17 commit 949e751

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

rustmail/src/db/operations/scheduled.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ pub async fn get_scheduled_closure(
7474
pool: &SqlitePool,
7575
) -> ModmailResult<Option<ScheduledClosure>> {
7676
let row_opt = sqlx::query(
77-
"SELECT thread_id, close_at, silent FROM scheduled_closures WHERE thread_id = ?",
77+
"SELECT thread_id, close_at, silent, closed_by, category_id, category_name, required_permissions FROM scheduled_closures WHERE thread_id = ?",
7878
)
7979
.bind(thread_id)
8080
.fetch_optional(pool)
8181
.await
82-
.map_err(|_| common::validation_failed("Failed to fetch scheduled closure"))?;
82+
.map_err(|_| validation_failed("Failed to fetch scheduled closure"))?;
8383

8484
Ok(row_opt.map(|row| ScheduledClosure {
8585
thread_id: row.get::<String, _>(0),

rustmail/src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ async fn main() {
8787
.route("/", axum::routing::get(static_handler))
8888
.route("/{*path}", axum::routing::get(static_handler));
8989

90-
let listener = tokio::net::TcpListener::bind("0.0.0.0:3002").await.unwrap();
90+
let api_address = config.bot.ip.unwrap_or_else(|| "0.0.0.0".to_string());
91+
92+
let listener = tokio::net::TcpListener::bind(format!("{}:{}", api_address, 3002)).await.unwrap();
9193
println!("listening on {}", listener.local_addr().unwrap());
9294

9395
axum::serve(

0 commit comments

Comments
 (0)