Skip to content

Feature/connect employee card tile to backend#72

Merged
Thomasbenissan merged 3 commits intomainfrom
feature/connect_employee_card_tile_to_backend
Mar 24, 2026
Merged

Feature/connect employee card tile to backend#72
Thomasbenissan merged 3 commits intomainfrom
feature/connect_employee_card_tile_to_backend

Conversation

@sihaosimonz
Copy link
Copy Markdown
Contributor

  • Fetch employee data from the backend endpoint
  • Ensure loading skeletons appear before data is fetched
  • On successful fetch, replace skeletons with populated cards
  • Support live re-rendering if filters or search terms change.

@Thomasbenissan
Copy link
Copy Markdown
Collaborator

Hey Simon, nice work connecting the directory to the backend. I went through the PR and made a round of fixes directly on the branch:

  1. Renamed role to jobTitle
    The existing position field holds auth-tier values ("Manager", "HR", "Employee") used across evals/HR services. Having a separate role field next to it is confusing. jobTitle is unambiguous. Updated across schema, seed, API, types, filters, and components.

  2. Removed email from UserMetadata, now fetched from Supabase Auth
    Email already lives in Supabase's auth.users table. Duplicating it creates sync risk. The API route now fetches emails via auth.admin.listUsers() and zips them into the response.

  3. Removed online and away fields
    Static booleans in Postgres won't reflect real presence.

  4. Fixed DirectoryApiEmployee type
    The interface declared is_admin and is_hr, but the API never returns them. They'd be undefined at runtime. Removed so the type matches the actual response.

  5. Updated shared UserMetadata type in src/types/auth.ts
    Added the new fields (department, jobTitle, bio, etc.) so the rest of the app is aware of them.

  6. Added error state for fetch failure
    Previously a failed fetch just showed "No employees found." Now shows a proper error message.

  7. Changed birthday from String to DateTime? @db.Date
    Matches the rest of the schema. The API formats it to YYYY-MM-DD for the frontend.

  8. Restored "Results:" heading in ResultsGrid
    The skeleton refactor accidentally dropped the heading and outer wrapper padding.

  9. Migration needed
    Please run npx prisma migrate dev --name add-directory-fields with your local DB up and include the generated migration before merging.

@Thomasbenissan Thomasbenissan merged commit c7f29df into main Mar 24, 2026
1 check passed
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.

2 participants