Register endpoint #16

Merged
phoenix merged 56 commits from register_endpoint-init into devel 2025-04-05 19:26:59 +00:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit f6f2370fee - Show all commits

View File

@@ -53,13 +53,13 @@ pub async fn register_user(
match repo::user::exists(&pool, &user.username).await {
Ok(res) => {
if res {
return (
(
StatusCode::NOT_FOUND,
Json(response::Response {
message: String::from("Error"),
data: vec![user],
}),
);
)
} else {
match repo::user::insert(&pool, &user).await {
Ok(id) => {

View File

@@ -13,7 +13,7 @@ pub mod user {
SELECT 1 FROM "user" WHERE username = $1
"#,
)
.bind(&username)
.bind(username)
.fetch_optional(pool)
.await;