Skip to content

Added event deletion functionality#2131

Merged
maernest04 merged 1 commit into
devfrom
ernest_ma/add_event_deletion
May 2, 2026
Merged

Added event deletion functionality#2131
maernest04 merged 1 commit into
devfrom
ernest_ma/add_event_deletion

Conversation

@maernest04

Copy link
Copy Markdown
Collaborator

PR for #2120

Problem:

Admins were unable to delete events from the UI. To delete events from SCEvents we had to manually send commands to remove them from Redis and MongoDB.

Solution:

Implement a secure deletion flow that includes user confirmation and status validation, ensuring only non-published events can be removed through the interface.

Files Changed:

  • src/APIFunctions/SCEvents.js
  • src/Pages/Events/EditEventPage.js
  • src/Pages/Events/EventEditorForm.js

Screenshot of the danger zone delete event button

Screenshot 2026-05-02 at 12 27 46 AM

- Added a delete SCEvent API for invididual event deletion
- Added the danger zone and delete event button at the bottom of the edit event page
- Made deletion of an event only available when the event is either in draft or closed mode
async function handleConfirmDelete() {
setDeleteError('');
setDeleteSubmitting(true);
const token = window.localStorage.getItem('jwtToken');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i might be wrong but i believe there is a hook called useSCE which lets you extract the token without needing to directly access local storage. see here. if the token you're accessing is different from the clark jwt token then forget i said any of this

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this is true lol + we should probably update all refs in SCEvents in Clark

can you open a new PR to do this @maernest04 ? we can just merge this for now + do the "refactor" in a new focused PR

@maernest04 maernest04 merged commit de7b1f1 into dev May 2, 2026
4 checks passed
@maernest04 maernest04 deleted the ernest_ma/add_event_deletion branch May 2, 2026 20:11
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.

4 participants