Skip to content

Feature/admin doc view front connect backend#52

Merged
Thomasbenissan merged 21 commits intomainfrom
feature/admin-doc-view-front-connect-backend
Feb 16, 2026
Merged

Feature/admin doc view front connect backend#52
Thomasbenissan merged 21 commits intomainfrom
feature/admin-doc-view-front-connect-backend

Conversation

@sihaosimonz
Copy link
Copy Markdown
Contributor

  • Connect file upload frontend to backend
    • On upload, create new Files row in Postgres via Prisma & file bytes sent to Supabase Storage
    • Currently using admin with id 00000000-0000-0000-0000-000000000001 as owner for testing
    • Files are uploaded to files bucket
  • Allow admin to view actual files stored in files bucket
    • Document cards now read from the Files table instead of dummy data
    • Requires files bucket to be public in local dev; secured access via signed URLs to be implemented

@andrewtlu
Copy link
Copy Markdown
Member

#38

…dmin accessibility to files; Add dynamically fetching current userId instead of hardcoded id
@sihaosimonz
Copy link
Copy Markdown
Contributor Author

4:30 pm Fri Dec 5

  • Implement signed-URL flow for fetching files from Supabase to improve security.
  • Load the current user dynamically from Supabase auth instead of hard-coding the user1 ID.
  • Tidy up file access rules: ensure admins can view all files while restricting non-admin access.
  • Will resolve merge conflicts / version differences by end of Dec 5.

TODOs for future sprints:

  • AdminDocuments.tsx: wire up “re-upload file” logic.
  • AdminDocuments.tsx: replace owner ID strings with employee names once the employee selection / auto-populate logic is implemented.

@sihaosimonz sihaosimonz marked this pull request as ready for review December 5, 2025 21:52
@Thomasbenissan
Copy link
Copy Markdown
Collaborator

Thomasbenissan commented Jan 9, 2026

Overall: Good work! The file upload is properly connected to the backend and the core functionality is working. A few items to address before merging:

  1. Build Failure - Type Error (Blocking)
    The production build fails due to incorrect typing in src/app/api/documents/route.ts:57:

Current:
export async function GET(req: NextResponse)

Should be:
export async function GET(req: NextRequest)
Make sure to import NextRequest from next/server.

  1. Employee Selector - Use Name/Email Instead of UUID
    Replace the free-text UUID input with an autocomplete dropdown. As the user types, display a filtered list of employee names/emails for easy selection. (Ik you mentioned this in the todo's, I think this is something that should be done in this task as you're familair with the current infrastructure)

  2. Edit Button Visibility
    Hide the Edit button on files that have been shared with the viewer. Files should only be editable by the user who uploaded them. (Again, I know this is a UI/UX component but I think it should be part of this task)

  3. Edit Modal - Show All Viewers
    When clicking Edit, the viewer list should display ALL eligible viewers of the file, including:
    Yourself (the uploader)
    Any additional viewers already assigned to the file
    Currently it only shows newly added recipients, not the complete list.

Overall, again, great great work! Just some minor tweaks to be made and this looks good.

@sihaosimonz sihaosimonz marked this pull request as draft February 11, 2026 03:54
Copy link
Copy Markdown
Collaborator

@Thomasbenissan Thomasbenissan left a comment

Choose a reason for hiding this comment

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

Looks great overall. Nice work connecting the admin documents frontend to backend, wiring upload/list/view/edit flows, and polishing the user search + viewer experience. The implementation is clear and the end-to-end behavior looks solid. Approved.

@Thomasbenissan Thomasbenissan marked this pull request as ready for review February 16, 2026 23:20
@Thomasbenissan Thomasbenissan merged commit 6214e57 into main Feb 16, 2026
1 check passed
@Thomasbenissan Thomasbenissan deleted the feature/admin-doc-view-front-connect-backend branch February 16, 2026 23:20
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.

3 participants