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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user