Register service user endpoint #5

Merged
phoenix merged 12 commits from register_service_user into main 2026-06-11 14:36:10 -04:00
3 changed files with 5 additions and 1 deletions
Showing only changes of commit ebe53f51c9 - Show all commits
+1
View File
@@ -0,0 +1 @@
pub const SUCCESSFUL_MESSAGE: &str = "Successful";
+1
View File
@@ -1,5 +1,6 @@
pub mod common;
pub mod login;
pub mod messages;
pub mod register;
pub mod endpoints {
+3 -1
View File
@@ -237,8 +237,10 @@ pub async fn register_service_user(
match repo::service::insert(&pool, &service_user).await {
Ok(created) => {
resp.message = String::from(super::messages::SUCCESSFUL_MESSAGE);
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) => {
resp.message = err.to_string();