Code formatting

This commit is contained in:
2026-06-26 20:50:05 -04:00
parent 131a4d163e
commit b93ace85cd
4 changed files with 26 additions and 16 deletions
+7 -5
View File
@@ -61,11 +61,11 @@ impl Service {
};
let sch_msg = super::scheduler::ScheduledMessage {
app: self.app.clone(),
token: self.token.clone()
token: self.token.clone(),
};
let mer_req = super::mer::MessageEventResponse {
app: self.app.clone(),
token: self.token.clone()
token: self.token.clone(),
};
let events = events.unwrap_or_default();
@@ -98,13 +98,13 @@ impl Service {
let param = swoosh::twilio::types::Parameters {
schedule: true,
schedule_at: scheduled_message.scheduled
schedule_at: scheduled_message.scheduled,
};
let twilio_config = &self.app.twilio_config;
match swoosh::twilio::api::send_message(&message, contact, &param, twilio_config).await {
match swoosh::twilio::api::send_message(&message, contact, &param, twilio_config).await
{
Ok(resp) => {
// MER response
let result = swoosh::twilio::api::response_to_json(resp).await;
@@ -133,6 +133,7 @@ impl Service {
}
}
/*
todo!(
r#"
Need to finish this
@@ -153,6 +154,7 @@ impl Service {
9. Add to scheduler
"#
);
*/
}
fn is_schedulable(
+3 -1
View File
@@ -27,7 +27,9 @@ impl Event {
},
Err(err) => Err(std::io::Error::other(err)),
},
_ => Err(std::io::Error::other("Error getting token")),
_ => Err(std::io::Error::other(
"Error getting Scheduled Message Event",
)),
},
Err(err) => Err(std::io::Error::other(err.to_string())),
}
+8 -2
View File
@@ -10,7 +10,7 @@ impl MessageEventResponse {
) -> Result<textsender_models::message::event::MessageEventResponse, std::io::Error> {
let client = reqwest::Client::new();
let endpoint = String::from("api/v1/schedule/message/event/response/record");
let api_url = format!("{}/{endpoint}", self.app.auth_url);
let api_url = format!("{}/{endpoint}", self.app.api_url);
println!("Url: {api_url:?}");
@@ -36,7 +36,13 @@ impl MessageEventResponse {
let (key, header) = super::auth_header(&self.token.access_token);
match client.post(api_url).json(&payload).header(key, header).send().await {
match client
.post(api_url)
.json(&payload)
.header(key, header)
.send()
.await
{
Ok(response) => match response.status() {
reqwest::StatusCode::CREATED | reqwest::StatusCode::OK => {
println!("Response: {response:?}");
+2 -2
View File
@@ -9,7 +9,7 @@ impl ScheduledMessage {
scheduled_message_id: &uuid::Uuid,
) -> Result<textsender_models::message::scheduling::ScheduledMessage, std::io::Error> {
let client = reqwest::Client::new();
let endpoint = format!("api/v1/scheduled/message?id={scheduled_message_id}");
let endpoint = format!("api/v1/schedule/message?id={scheduled_message_id}");
let api_url = format!("{}/{endpoint}", self.app.api_url);
println!("Url: {api_url:?}");
@@ -25,7 +25,7 @@ impl ScheduledMessage {
},
Err(err) => Err(std::io::Error::other(err)),
},
_ => Err(std::io::Error::other("Error getting token")),
_ => Err(std::io::Error::other("Error getting Scheduled Message")),
},
Err(err) => Err(std::io::Error::other(err.to_string())),
}