Skip to content

🐛 fix: Update deletePromptController to include user role in query #5488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

danny-avila
Copy link
Owner

@danny-avila danny-avila commented Jan 26, 2025

Closes #5486

Summary

  • Updated the query in deletePromptController to include req.user.role
  • Removed conditional logic that removed the author for admin users (redundant)

Change Type

  • Bug fix (non-breaking change which fixes an issue)

Testing

I tested these changes locally by attempting to delete prompts under different user roles and confirming the correct behavior each time. Additional unit tests can be written to ensure role-based checks are validated under different scenarios.

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have tested my changes
  • Local unit tests pass with my changes

@danny-avila danny-avila merged commit 12a9a07 into main Jan 27, 2025
2 checks passed
@danny-avila danny-avila deleted the fix/prompt-admin-delete branch January 27, 2025 00:03
@jameslamine
Copy link
Contributor

Thanks! I guess I can close my PR with a similar fix #5487

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.

[Bug]: Admin user not able to delete prompts
2 participants