File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
pages/api/reports/internal Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,8 @@ export default function InternalReports(): JSX.Element {
3939
4040 const HiddenFormToSubmit = ( { submittedFormData } : any ) => {
4141 const { reportType, startDate, endDate } = submittedFormData ;
42+ const payloadStartDate = new Date ( startDate ) . toISOString ( ) . split ( 'T' ) [ 0 ] ;
43+ const payloadEndDate = new Date ( endDate ) . toISOString ( ) . split ( 'T' ) [ 0 ] ;
4244
4345 return (
4446 < form
@@ -47,8 +49,8 @@ export default function InternalReports(): JSX.Element {
4749 ref = { internalReportForm }
4850 >
4951 < input type = "hidden" name = "ReportType" value = { reportType } />
50- < input type = "hidden" name = "StartDate" value = { startDate } />
51- < input type = "hidden" name = "EndDate" value = { endDate } />
52+ < input type = "hidden" name = "StartDate" value = { payloadStartDate } />
53+ < input type = "hidden" name = "EndDate" value = { payloadEndDate } />
5254 </ form >
5355 ) ;
5456 } ;
Original file line number Diff line number Diff line change @@ -25,9 +25,9 @@ const endpoint: NextApiHandler = async (
2525 try {
2626 const file = await downloadInternalReport (
2727 {
28- StartDate : new Date ( req . body . StartDate ) . toISOString ( ) . split ( 'T' ) [ 0 ] ,
29- EndDate : new Date ( req . body . EndDate ) . toISOString ( ) . split ( 'T' ) [ 0 ] ,
3028 ReportType : parseInt ( req . body . ReportType ) ,
29+ StartDate : req . body . StartDate ,
30+ EndDate : req . body . EndDate ,
3131 } ,
3232 req
3333 ) ;
You can’t perform that action at this time.
0 commit comments