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 6dd8ddb0df - Show all commits

View file

@ -20,6 +20,7 @@ pub fn router(app_state: Arc<AppState>) -> Router<Arc<AppState>> {
.nest("/users", users::router())
.nest("/guilds", guilds::router())
.nest("/invites", invites::router())
.nest("/members", members::router())
.nest("/me", me::router())
.layer(from_fn_with_state(
app_state.clone(),
@ -30,6 +31,5 @@ pub fn router(app_state: Arc<AppState>) -> Router<Arc<AppState>> {
.route("/stats", get(stats::res))
.nest("/auth", auth::router(app_state.clone()))
.nest("/channels", channels::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
.nest("/members", members::router())
.merge(router_with_auth)
}