From 76bb3a1f62fef5e01b440ae32631049e8f137834 Mon Sep 17 00:00:00 2001 From: phoenix Date: Mon, 15 Jun 2026 22:39:50 -0400 Subject: [PATCH] Got it working --- src/caller/contact.rs | 6 +++--- src/caller/mod.rs | 2 +- src/config/mod.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/caller/contact.rs b/src/caller/contact.rs index aa4aed4..36e1b0f 100644 --- a/src/caller/contact.rs +++ b/src/caller/contact.rs @@ -257,9 +257,9 @@ pub mod endpoint { if payload.is_valid() { match contact_repo::get(&pool, &payload.id).await { Ok(contact) => { - let mut old_firstname: Option = contact.firstname.clone(); - let mut old_lastname: Option = contact.lastname.clone(); - let mut old_nickname: Option = contact.nickname.clone(); + let old_firstname: Option = contact.firstname.clone(); + let old_lastname: Option = contact.lastname.clone(); + let old_nickname: Option = contact.nickname.clone(); let new_firstname = match payload.firstname { Some(firstname) => Some(firstname), None => None, diff --git a/src/caller/mod.rs b/src/caller/mod.rs index e269cdf..17bc20a 100644 --- a/src/caller/mod.rs +++ b/src/caller/mod.rs @@ -8,7 +8,7 @@ pub mod endpoints { /// Constant for getting Contact endpoint pub const GET_CONTACT: &str = "/api/v1/contact"; /// Constant for updating names of a Contact endpoint - pub const UPDATE_CONTACT_NAME: &str = "/api/v1/contact/new"; + pub const UPDATE_CONTACT_NAME: &str = "/api/v1/contact/update"; } pub mod response { diff --git a/src/config/mod.rs b/src/config/mod.rs index 3ffa738..105fb1c 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -10,7 +10,7 @@ pub mod host { pub mod init { use std::time::Duration; - use axum::routing::{get, post}; + use axum::routing::{get, patch, post}; use tower_http::timeout::TimeoutLayer; use utoipa::OpenApi; @@ -97,7 +97,7 @@ pub mod init { ) .route( crate::caller::endpoints::UPDATE_CONTACT_NAME, - get(contact_endpoints::update_contact_names).route_layer( + patch(contact_endpoints::update_contact_names).route_layer( axum::middleware::from_fn(crate::auth::auth::), ), )