You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 25, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 25, 2025. It is now read-only.
Should API routes be revolving around chapters #251
@timmyichen, @Zeko369, @nik-john, @allella I was looking at the api routes and I realized that the routes are revolving around chapters. What if an organization doesn't have a chapter?
Just, for example, assume we have Coders.org as an organization and they don't want any chapters under them, they host events under the organization's name. In that case, our routes will return 404, right? I think we should include /events, /events/eventId and so on as routes. What do you all think?
I mean we could have separate /events, and /events/:eventID routes, but why not just make it simple and have /chapters/1/events/:eventID, and then on setup just create a default chapter that you for example cant delete if it's the only one.
Let me just see if you understand what you're saying. Organization would be a person/organization hosting a chapter docker container?
If so, my idea was that we tie everything to a chapter, so when you set it up the first time you create one chapter, and if there's only it's treated as the organization.
example: foobar rails meetup would create a chapter instance running on foobar.rails.org and have one chapter in the database called eg. foobar rails. Later they could add more like barfoo rails, running on the same host.
Correct me if I'm wrong?
This is a good question, though I would agree with still making everything run through the Chapter-based schema, even if there's only 1 chapter in an organization.
I feel it's easier to hide or tweak things in the UI, for example hiding the "Chapters" menu link if there's only 1 Chapter, then it is to have a secondary pattern / API to support single-Chapter organizations.
Activity
Zeko369 commentedon Nov 18, 2019
I mean we could have separate
/events, and/events/:eventIDroutes, but why not just make it simple and have/chapters/1/events/:eventID, and then on setup just create a default chapter that you for example cant delete if it's the only one.vkWeb commentedon Nov 18, 2019
@Zeko369 You mean the organization will be treated as a chapter if there's no chapter under them?
Zeko369 commentedon Nov 18, 2019
Let me just see if you understand what you're saying. Organization would be a person/organization hosting a chapter docker container?
If so, my idea was that we tie everything to a chapter, so when you set it up the first time you create one chapter, and if there's only it's treated as the organization.
example:
foobar rails meetupwould create a chapter instance running onfoobar.rails.organd have onechapterin the database called eg.foobar rails. Later they could add more likebarfoo rails, running on the same host.Correct me if I'm wrong?
vkWeb commentedon Nov 18, 2019
@Zeko369 You are correct. That's what I was confirming.
allella commentedon Nov 18, 2019
This is a good question, though I would agree with still making everything run through the Chapter-based schema, even if there's only 1 chapter in an organization.
I feel it's easier to hide or tweak things in the UI, for example hiding the "Chapters" menu link if there's only 1 Chapter, then it is to have a secondary pattern / API to support single-Chapter organizations.
vkWeb commentedon Nov 18, 2019
@allella Yes, that would be better instead of tweaking the whole API structure.