As a site admin, I want special slugs to be rejected when creating pages, so that I can avoid unintended behaviour

Open Beginner friendly
#246 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
64/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
backend

Research direction

Find the page creation and editing entry points that handle /pages, /pages/new, and /pages/[...slug]; the issue does not name files or tests. Read how page slugs are validated and how the edit suffix is routed. Reject new and edit slugs, including in subpages, with a descriptive message, and confirm both creation and editing requests are rejected.

Written by the indexing model from the issue text.

Description

suggestion
📝 Description

Pages themselves and their actions are under the same path: /pages , /pages/new and /pages/[...slug]

If the slug ends with "edit" this is treated specially and presents the edit form for that page. This could lead to path collisions if a page is created with the slug "new" or "edit"

✅ Acceptance Criteria
  • When attempting to create or edit a page with the slug edit or new, including in subpages, a descriptive message is shown and the request is rejected
💡 Additional context

Original CodeRabbit comment: https://github.com/cthit/chalmers.it/pull/244#discussion_r4732367137

Dominant language
TypeScript
Stars
6
Forks
5
Avg merge
3d 17h
Merged PRs (30d)
3

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cthit/chalmers.it

All issues in cthit/chalmers.it

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.