Templates and TLS requests
Refactored HTML templates and added TLS back to issue HTTP requests
This commit is contained in:
@@ -73,9 +73,7 @@ pub async fn create_post(
|
||||
.await
|
||||
.context("Failed to enqueue delivery tasks.")?;
|
||||
|
||||
let template = MessageTemplate::Success {
|
||||
message: "Your new post has been published!".into(),
|
||||
};
|
||||
let template = MessageTemplate::success("Your new post has been published!".into());
|
||||
let response = Html(template.render().unwrap()).into_response();
|
||||
let response = save_response(transaction, &idempotency_key, user_id, response)
|
||||
.await
|
||||
@@ -138,9 +136,7 @@ pub async fn delete_post(
|
||||
"We could not find the post in the database."
|
||||
)))
|
||||
} else {
|
||||
let template = MessageTemplate::Success {
|
||||
message: "The subscriber has been deleted.".into(),
|
||||
};
|
||||
let template = MessageTemplate::success("The subscriber has been deleted.".into());
|
||||
Ok(template.render().unwrap().into_response())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user