Skip to content

Commit

Permalink
Avoid routing /groups/:groupName/settings as a dataset
Browse files Browse the repository at this point in the history
Redirect to the group's home page instead, a la …/narratives.
Presumably this route will serve a settings page instead in the future.
  • Loading branch information
tsibley committed Feb 15, 2023
1 parent 1d2eef6 commit 22e49a3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,12 @@ app.routeAsync("/groups/:groupName")
app.use("/groups/:groupName/settings",
endpoints.groups.setGroup(req => req.params.groupName));

/* Avoid matching "settings" as a dataset name; presumably this will eventually
* serve a settings page instead.
*/
app.routeAsync("/groups/:groupName/settings")
.getAsync((req, res) => res.redirect(`/groups/${esc(req.params.groupName)}`));

app.routeAsync("/groups/:groupName/settings/logo")
.getAsync(getGroupLogo)
.putAsync(putGroupLogo)
Expand Down

0 comments on commit 22e49a3

Please sign in to comment.