Skip to content

feat(team): connect time-off form to API (Closes #437)#467

Merged
codeZe-us merged 6 commits into
SafeVault:devfrom
AdityaK9822:feat/437-connect-time-off-submission
Apr 29, 2026
Merged

feat(team): connect time-off form to API (Closes #437)#467
codeZe-us merged 6 commits into
SafeVault:devfrom
AdityaK9822:feat/437-connect-time-off-submission

Conversation

@AdityaK9822
Copy link
Copy Markdown
Contributor

Description

This PR hooks up the employee leave/time-off request submission form directly to the backend API.

Implementation Specifics

  1. Frontend Integration:

    • Modified src/components/features/team-management/timeOff/CreateTimeOffForm.tsx to bind the form submission to POST /api/v1/team/time-off.
    • Handled form payload serialization specifically mapped to the TimeOffRequestSchema, ensuring startDate, endDate, leaveType, and reason are correctly passed.
    • Added robust UX feedback states (success/error banners) mapped dynamically to the API response.
  2. Backend Enhancements:

    • Updated TimeOffService in src/server/services/time-off.service.ts to correctly extract the authenticated user's organization context.
    • Handled ZodError correctly in the route handler, returning fieldErrors array mapping to specific inputs when invalid properties are passed.
    • Submitting the form cleanly creates the record with status="pending" and appears instantly in the manager's pending queue.

Closes #437

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 28, 2026

@AdityaK9822 is attempting to deploy a commit to the vestroll's projects Team on Vercel.

A member of the Team first needs to authorize it.

@codeZe-us codeZe-us merged commit 0b1bd68 into SafeVault:dev Apr 29, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants