wip/kick #36

Merged
radical merged 9 commits from wip/kick into main 2025-07-22 16:56:37 +00:00
Showing only changes of commit 228bc68327 - Show all commits

View file

@ -13,7 +13,7 @@ mod invites;
mod me; mod me;
mod stats; mod stats;
mod users; mod users;
mod members; mod member;
pub fn router(app_state: Arc<AppState>) -> Router<Arc<AppState>> { pub fn router(app_state: Arc<AppState>) -> Router<Arc<AppState>> {
let router_with_auth = Router::new() let router_with_auth = Router::new()
@ -30,6 +30,6 @@ pub fn router(app_state: Arc<AppState>) -> Router<Arc<AppState>> {
.route("/stats", get(stats::res)) .route("/stats", get(stats::res))
.nest("/auth", auth::router(app_state.clone())) .nest("/auth", auth::router(app_state.clone()))
.nest("/channels", channels::router(app_state.clone())) .nest("/channels", channels::router(app_state.clone()))
.nest("/members", members::router(app_state)) .nest("/member", member::router(app_state))
radical marked this conversation as resolved Outdated

this should be moved to the router_with_auth instead as all endpoints inside /members needs auth, also it should be /members plural and not /member singular. This also goes for the folder/module name

this should be moved to the router_with_auth instead as all endpoints inside /members needs auth, also it should be `/members` plural and not `/member` singular. This also goes for the folder/module name

why plural, we are only accessing a single member

why plural, we are only accessing a single member

@baaboe wrote in #36 (comment):

why plural, we are only accessing a single member

Because it’s accessing a singular resource from the members resource collection. It’s a REST API thing.

@baaboe wrote in https://git.gorb.app/gorb/backend/pulls/36#issuecomment-831: > why plural, we are only accessing a single member Because it’s accessing a singular resource from the `members` resource *collection*. It’s a REST API thing.

/members contains all members, even though you're only accessing one, think of it like a folder tree with /members containing all of the members of every guild out there but you only have access to a subset of them

`/members` contains *all* members, even though you're only accessing one, think of it like a folder tree with /members containing all of the members of every guild out there but you only have access to a subset of them
.merge(router_with_auth) .merge(router_with_auth)
} }