fix: simplify EmployeeQuestionnaireNew to use invite-only flow

- Remove all authentication and org context dependencies
- Simplify component to work only with invite codes from URL
- Remove complex user/employee matching logic
- Keep exact Figma UI components and styling
- Use only submitViaInvite function for API submissions
- Employees never need to log in, only use invite link
This commit is contained in:
Ra
2025-08-25 14:42:33 -07:00
parent daa89b6cbf
commit 0d7b8d104b
13 changed files with 311 additions and 357 deletions

View File

@@ -424,14 +424,9 @@ export const OrgProvider: React.FC<{ children: React.ReactNode; selectedOrgId: s
riskLevel: 'Unknown'
},
gradingBreakdown: [],
operatingPlan: { nextQuarterGoals: [], keyInitiatives: [], resourceNeeds: [], riskMitigation: [] },
personnelChanges: { newHires: [], promotions: [], departures: [] },
keyPersonnelChanges: [],
immediateHiringNeeds: [],
forwardOperatingPlan: { quarterlyGoals: [], resourceNeeds: [], riskMitigation: [] },
organizationalStrengths: [],
organizationalRisks: [],
gradingOverview: {},
executiveSummary: 'Company report generated successfully.',
// Override with API data if available
...(payload as any || {})
@@ -556,10 +551,6 @@ export const OrgProvider: React.FC<{ children: React.ReactNode; selectedOrgId: s
},
submitEmployeeAnswers: async (employeeId: string, answers: Record<string, string>) => {
try {
if (!user?.uid) {
throw new Error('User authentication required');
}
// Use secure API for submission
await secureApi.submitEmployeeAnswers(employeeId, answers);