Changing data of response
This commit is contained in:
@@ -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],
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user