Changing data of response

This commit is contained in:
2025-04-04 22:39:42 -04:00
parent 83f0e777c9
commit 550947f051

View File

@@ -31,7 +31,7 @@ pub mod response {
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize)]
pub struct Response { pub struct Response {
pub message: String, pub message: String,
pub data: models::common::User, pub data: Vec<models::common::User>,
} }
} }
@@ -52,7 +52,7 @@ pub async fn register_user(
StatusCode::CREATED, StatusCode::CREATED,
Json(response::Response { Json(response::Response {
message: String::from("User inserted"), message: String::from("User inserted"),
data: user, data: vec![user],
}), }),
) )
} }
@@ -60,7 +60,7 @@ pub async fn register_user(
StatusCode::BAD_REQUEST, StatusCode::BAD_REQUEST,
Json(response::Response { Json(response::Response {
message: err.to_string(), message: err.to_string(),
data: user, data: vec![user],
}), }),
), ),
} }