Change route paths for user edits.
This commit is contained in:
@@ -23,12 +23,13 @@ pub struct Data {
|
|||||||
password: String,
|
password: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[patch("/username", data = "<data>")]
|
#[patch("/<_ignore_id>/username", data = "<data>")]
|
||||||
pub async fn req(
|
pub async fn req(
|
||||||
auth: State<'_, Auth>,
|
auth: State<'_, Auth>,
|
||||||
session: Session,
|
session: Session,
|
||||||
user: User,
|
user: User,
|
||||||
data: Json<Data>,
|
data: Json<Data>,
|
||||||
|
_ignore_id: String,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
data.validate()
|
data.validate()
|
||||||
.map_err(|error| Error::FailedValidation { error })?;
|
.map_err(|error| Error::FailedValidation { error })?;
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ pub struct Data {
|
|||||||
profile: Option<UserProfile>,
|
profile: Option<UserProfile>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[patch("/", data = "<data>")]
|
#[patch("/<_ignore_id>", data = "<data>")]
|
||||||
pub async fn req(user: User, data: Json<Data>) -> Result<()> {
|
pub async fn req(user: User, data: Json<Data>, _ignore_id: String) -> Result<()> {
|
||||||
data.validate()
|
data.validate()
|
||||||
.map_err(|error| Error::FailedValidation { error })?;
|
.map_err(|error| Error::FailedValidation { error })?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user