Skip to content

Commit

Permalink
Remove legacy endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
bubelov committed Oct 16, 2024
1 parent 38541a4 commit a9cd970
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 86 deletions.
2 changes: 0 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ async fn main() -> Result<()> {
)
.service(
scope("users")
.service(user::admin::patch_tags)
.service(user::v2::get)
.service(user::v2::get_by_id),
)
Expand Down Expand Up @@ -196,7 +195,6 @@ async fn main() -> Result<()> {
)
.service(
scope("users")
.service(user::admin::patch_tags)
.service(user::v3::get)
.service(user::v3::get_by_id),
)
Expand Down
28 changes: 28 additions & 0 deletions src/rpc/set_user_tag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,31 @@ pub async fn run(Params(args): Params<Args>, pool: Data<Arc<Pool>>) -> Result<Re
tags: user.tags,
})
}

#[cfg(test)]
mod test {
use crate::Result;

#[tokio::test]
async fn patch_tags() -> Result<()> {
//let state = mock_state().await;
//let user = User::insert(1, &OsmUser::mock(), &state.conn)?;
//let admin_password = admin::service::mock_admin("test", &state.pool)
// .await
// .password;
//let app = test::init_service(
// App::new()
// .app_data(Data::new(state.pool))
// .service(super::patch_tags),
//)
//.await;
//let req = TestRequest::patch()
// .uri(&format!("/{}/tags", user.id))
// .append_header(("Authorization", format!("Bearer {admin_password}")))
// .set_json(json!({ "foo": "bar" }))
// .to_request();
//let res = test::call_service(&app, req).await;
//assert_eq!(res.status(), StatusCode::OK);
Ok(())
}
}
83 changes: 0 additions & 83 deletions src/user/admin.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/user/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pub mod model;
pub use model::User;
pub mod admin;
pub mod v2;
pub mod v3;

0 comments on commit a9cd970

Please sign in to comment.