-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
Description
Problem
The localToDate state variable in src/features/user/TreeMapper/Analytics/components/Export/index.tsx was changed from Date to Date | null but the code doesn't handle null values properly.
Issues to address
- Filename formatting: The
saveAsfunction usesformat(localToDate, 'dd-MMM-yy')which will throw an error iflocalToDateis null - API request body: The export request body includes
endDate: localToDatewhich may need null handling depending on API requirements
Suggested fixes
- Add conditional check before formatting:
localToDate ? format(localToDate, 'dd-MMM-yy') : 'no-date' - Handle null values in API request body appropriately
References
Reactions are currently unavailable