Got it working
This commit is contained in:
+6
-6
@@ -17,8 +17,8 @@ pub mod init {
|
||||
use crate::caller::contact as contact_caller;
|
||||
use crate::caller::message as message_caller;
|
||||
use contact_caller::endpoint as contact_endpoints;
|
||||
use message_caller::endpoint as message_endpoints;
|
||||
use contact_caller::response as contact_responses;
|
||||
use message_caller::endpoint as message_endpoints;
|
||||
use message_caller::response as message_responses;
|
||||
|
||||
mod cors {
|
||||
@@ -76,9 +76,9 @@ pub mod init {
|
||||
|
||||
#[derive(utoipa::OpenApi)]
|
||||
#[openapi(
|
||||
paths(contact_endpoints::create_contact,
|
||||
paths(contact_endpoints::create_contact,
|
||||
message_endpoints::create_message),
|
||||
components(schemas(contact_responses::AddContactResponse)),
|
||||
components(schemas(contact_responses::AddContactResponse, message_responses::AddMessageResponse)),
|
||||
tags(
|
||||
(name = "textsender API", description = "Web API to manage texting")
|
||||
)
|
||||
@@ -107,9 +107,9 @@ pub mod init {
|
||||
)
|
||||
.route(
|
||||
crate::caller::endpoints::ADD_MESSAGE,
|
||||
patch(message_endpoints::create_message).route_layer(
|
||||
axum::middleware::from_fn(crate::auth::auth::<axum::body::Body>),
|
||||
),
|
||||
post(message_endpoints::create_message).route_layer(axum::middleware::from_fn(
|
||||
crate::auth::auth::<axum::body::Body>,
|
||||
)),
|
||||
)
|
||||
.layer(cors::configure_cors().await)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user