First one #8
+6
-5
@@ -47,7 +47,7 @@ pub mod contact {
|
||||
pub message: String,
|
||||
// TODO: Should be this. Update code in textsender_models
|
||||
// pub data: Vec<textsender_models::contact::Contact>,
|
||||
pub data: Vec<uuid::Uuid>,
|
||||
pub data: Vec<textsender_models::contact::Contact>,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,10 +90,11 @@ pub mod contact {
|
||||
..Default::default()
|
||||
};
|
||||
match crate::repo::contact::insert(&pool, &contact).await {
|
||||
Ok(_) => (
|
||||
axum::http::StatusCode::NOT_IMPLEMENTED,
|
||||
axum::Json(response),
|
||||
),
|
||||
Ok(_) => {
|
||||
response.message = String::from(super::super::response::SUCCESSFUL);
|
||||
|
||||
(axum::http::StatusCode::CREATED, axum::Json(response))
|
||||
}
|
||||
Err(err) => {
|
||||
eprintln!("Error: {err:?}");
|
||||
response.message = String::from("Contact not created");
|
||||
|
||||
Reference in New Issue
Block a user