Change route paths for user edits.

This commit is contained in:
Paul
2021-04-03 15:02:29 +01:00
parent 7f5d6f2312
commit c3fa7bf74e
2 changed files with 4 additions and 3 deletions

View File

@@ -23,12 +23,13 @@ pub struct Data {
password: String,
}
#[patch("/username", data = "<data>")]
#[patch("/<_ignore_id>/username", data = "<data>")]
pub async fn req(
auth: State<'_, Auth>,
session: Session,
user: User,
data: Json<Data>,
_ignore_id: String,
) -> Result<()> {
data.validate()
.map_err(|error| Error::FailedValidation { error })?;

View File

@@ -15,8 +15,8 @@ pub struct Data {
profile: Option<UserProfile>,
}
#[patch("/", data = "<data>")]
pub async fn req(user: User, data: Json<Data>) -> Result<()> {
#[patch("/<_ignore_id>", data = "<data>")]
pub async fn req(user: User, data: Json<Data>, _ignore_id: String) -> Result<()> {
data.validate()
.map_err(|error| Error::FailedValidation { error })?;