Issue #5 and other related bug fixes and enhancements#6
Merged
Conversation
…to the users grid | added test cases
3 tasks
mrysav
approved these changes
Feb 22, 2026
Comment on lines
+141
to
+148
| // Handle nonprofit document uploads | ||
| if (userData.nonprofit?.create) { | ||
| const documentData = userData.nonprofit.create.nonprofitDocument?.create; | ||
| const fileBuffer = documentData?.fileData | ||
| ? Buffer.from(Object.values(documentData.fileData) as number[]) | ||
| : null; | ||
| const documentId = cuid(); | ||
|
|
Contributor
There was a problem hiding this comment.
Does this end up used anywhere? Not sure where eg documentId ends up being used again.
I see this was moved - disregard my comment!
Contributor
|
Looks good! I'll test it locally too before getting it to production. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User Admin Page
Overview
Implemented user deletion functionality and enhanced security controls for admin user management
Changes Made
1. User Deletion Feature
Created
src/app/users/user-delete-dialog.tsxEnhanced
src/app/users/users-grid.tsxCreated
src/app/users/api.tsfetchUsers,updateUser,deleteUser)2. Security Enhancements
Client-Side Protection
Server-Side Protection (
src/app/api/users/route.ts)3. Authentication Updates
Updated
types/next-auth.d.tsidfield to Session user typeUpdated
src/lib/auth.tssession.user.id = user.idto session callback4. Users API Test Cases
Files Changed
Created:
src/app/users/user-delete-dialog.tsxsrc/app/users/api.tssrc/app/api/users/route.test.tsModified:
src/app/users/users-grid.tsxsrc/app/api/users/route.tssrc/lib/auth.tstypes/next-auth.d.ts