Got it working
Rust Build / Rustfmt (pull_request) Failing after 36s
Rust Build / Test Suite (pull_request) Has been cancelled

This commit is contained in:
2026-06-17 17:07:25 -04:00
parent 5daee39a4e
commit 20bd0f9e4d
3 changed files with 6 additions and 3 deletions
+4 -1
View File
@@ -62,14 +62,17 @@ pub mod endpoint {
} else { } else {
if can_schedule(&payload.scheduled) { if can_schedule(&payload.scheduled) {
let mut scheduled_message = textsender_models::message::scheduling::ScheduledMessage { let mut scheduled_message = textsender_models::message::scheduling::ScheduledMessage {
user_id: payload.user_id, scheduled: payload.scheduled,
status: payload.status,
..Default::default() ..Default::default()
}; };
match scheduling_repo::insert(&pool, &scheduled_message, &payload.user_id).await { match scheduling_repo::insert(&pool, &scheduled_message, &payload.user_id).await {
Ok((id, created)) => { Ok((id, created)) => {
scheduled_message.id = id; scheduled_message.id = id;
scheduled_message.created = Some(created); scheduled_message.created = Some(created);
scheduled_message.user_id = payload.user_id;
response.message = String::from("Message scheduled"); response.message = String::from("Message scheduled");
response.data.push(scheduled_message);
(axum::http::StatusCode::CREATED, axum::Json(response)) (axum::http::StatusCode::CREATED, axum::Json(response))
} }
Err(err) => { Err(err) => {
+1 -1
View File
@@ -15,7 +15,7 @@ pub mod endpoints {
/// Constant for getting messages endpoint /// Constant for getting messages endpoint
pub const GET_MESSAGE: &str = "/api/v1/message"; pub const GET_MESSAGE: &str = "/api/v1/message";
/// Constant for scheduling message endpoint /// Constant for scheduling message endpoint
pub const SCHEDULE_MESSAGE: &str = "api/v1/schedule/message"; pub const SCHEDULE_MESSAGE: &str = "/api/v1/schedule/message";
} }
pub mod response { pub mod response {
+1 -1
View File
@@ -126,7 +126,7 @@ pub mod init {
) )
.route( .route(
crate::caller::endpoints::SCHEDULE_MESSAGE, crate::caller::endpoints::SCHEDULE_MESSAGE,
get(scheduling_endpoints::schedule_message).route_layer(axum::middleware::from_fn( post(scheduling_endpoints::schedule_message).route_layer(axum::middleware::from_fn(
crate::auth::auth::<axum::body::Body>, crate::auth::auth::<axum::body::Body>,
)), )),
) )