Skip to content

fix: add edit feature - #135

Open
gopikrishna-20 wants to merge 1 commit into
alphaonelabs:mainfrom
gopikrishna-20:feature/edit-activity
Open

gopikrishna-20 wants to merge 1 commit into
alphaonelabs:mainfrom
gopikrishna-20:feature/edit-activity

Conversation

@gopikrishna-20

Copy link
Copy Markdown
Contributor

Closes #134

Summary

Adds the ability for hosts to edit their activities. Includes a new PATCH /api/activities/:id endpoint and an edit-activity page

Changes

Backend (src/worker.py)

  • New api_update_activity handler for PATCH /api/activities/:id
    • Host-only (403 for anyone else, 401 if unauthenticated)
    • Partial updates: only fields present in the body are changed
    • Validates title (required if sent, max 200), description (max 5000), learning_objectives and prerequisites (max 2000), level (max 50), and allowed values for type, format and schedule_type
    • Tags: max 10 per activity, max 50 characters each, de-duplicated
    • description, learning_objectives and prerequisites are encrypted with AES-256-GCM
    • The field update and tag replacement run in one env.DB.batch() transaction
  • Registered the PATCH route in _dispatch
  • Added /edit-activity to STATIC_CLEAN_ROUTES

Frontend (public/edit-activity.html)

  • New edit form, pre-filled from GET /api/activities/:id
  • Redirects to login when there is no token, and shows an error when the user is not the host
  • Saves via PATCH and returns to the dashboard

Config (wrangler.toml)

  • Added /edit-activity to assets.run_worker_first
  • Added /confirm-password-change, which had the same problem
Screen.Recording.2026-10-21.120044.mp4

Copilot AI balanced review requested due to automatic review settings October 21, 2026 06:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: alphaonelabs/coderabbit/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 9859beee-0714-475f-a2b1-c32bd2e753e4
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add edit an activity button

2 participants