Adding constant file
Rust Build / Check (pull_request) Successful in 31s
Rust Build / Rustfmt (pull_request) Successful in 31s
Rust Build / Test Suite (pull_request) Successful in 1m19s
Rust Build / Clippy (pull_request) Successful in 1m14s
Rust Build / build (pull_request) Successful in 1m48s
Rust Build / Check (pull_request) Successful in 31s
Rust Build / Rustfmt (pull_request) Successful in 31s
Rust Build / Test Suite (pull_request) Successful in 1m19s
Rust Build / Clippy (pull_request) Successful in 1m14s
Rust Build / build (pull_request) Successful in 1m48s
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
pub const SUCCESSFUL_MESSAGE: &str = "Successful";
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
pub mod common;
|
pub mod common;
|
||||||
pub mod login;
|
pub mod login;
|
||||||
|
pub mod messages;
|
||||||
pub mod register;
|
pub mod register;
|
||||||
|
|
||||||
pub mod endpoints {
|
pub mod endpoints {
|
||||||
|
|||||||
@@ -237,8 +237,10 @@ pub async fn register_service_user(
|
|||||||
|
|
||||||
match repo::service::insert(&pool, &service_user).await {
|
match repo::service::insert(&pool, &service_user).await {
|
||||||
Ok(created) => {
|
Ok(created) => {
|
||||||
|
resp.message = String::from(super::messages::SUCCESSFUL_MESSAGE);
|
||||||
service_user.created = Some(created);
|
service_user.created = Some(created);
|
||||||
(axum::http::StatusCode::NOT_IMPLEMENTED, axum::Json(resp))
|
resp.data.push(service_user);
|
||||||
|
(axum::http::StatusCode::CREATED, axum::Json(resp))
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
resp.message = err.to_string();
|
resp.message = err.to_string();
|
||||||
|
|||||||
Reference in New Issue
Block a user