New endpoint 'members' with get and delete
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
This commit is contained in:
parent
f5d4211fad
commit
82f4388dab
4 changed files with 108 additions and 2 deletions
22
src/api/v1/members/mod.rs
Normal file
22
src/api/v1/members/mod.rs
Normal file
|
@ -0,0 +1,22 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use axum::{
|
||||
Router,
|
||||
middleware::from_fn_with_state,
|
||||
routing::{any, delete, get, patch},
|
||||
};
|
||||
//use socketioxide::SocketIo;
|
||||
|
||||
use crate::{AppState, api::v1::auth::CurrentUser};
|
||||
|
||||
mod uuid;
|
||||
|
||||
pub fn router(app_state: Arc<AppState>) -> Router<Arc<AppState>> {
|
||||
let router_with_auth = Router::new()
|
||||
.route("/{uuid}", get(uuid::get))
|
||||
.route("/{uuid}", delete(uuid::delete))
|
||||
.layer(from_fn_with_state(app_state, CurrentUser::check_auth_layer));
|
||||
|
||||
Router::new()
|
||||
.merge(router_with_auth)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue