Misleading Route Parameter Names in Subscription Routes
Hello sir, im one of your subscriber in youtube...whatever i learn related to coding from you and codeWithHarry channel.... I saw your full playlist related to this, and trying to code rest of the controllers, but find this confusions here.....
Im not expert in this now, please forgive me if i didn't understand you.....please guide me here sir.....
The route parameter names in subscription.routes.js are semantically swapped, causing confusion about what ID each route actually expects.
Current Behavior
Route 1: /c/:channelId → mapped to getSubscribedChannels
- The param is named
:channelId, but this controller needs a subscriber's ID to fetch all channels that user has subscribed to.
Route 2: /u/:subscriberId → mapped to getUserChannelSubscribers
- The param is named
:subscriberId, but this controller needs a channel owner's ID to fetch all subscribers of that channel.
The parameter names are effectively swapped relative to what each controller actually uses.
Expected Behavior
Route parameter names should reflect what ID they actually represent:
// Suggested fix router.route("/c/:subscriberId").get(getSubscribedChannels); router.route("/u/:channelId").get(getUserChannelSubscribers);
Source: hiteshchoudhary/chai-backend