From 0a134df39968d0451fc17b79c208d7f63da504f9 Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Wed, 13 Nov 2024 14:59:15 -0700 Subject: [PATCH 1/2] Remove parameters for NARS 2023 --- .../controllers/admin/reporting-controller.ts | 6 ++--- src/api/routes/admin/index.ts | 4 ++-- .../Administration/store/ReportsStore.js | 24 ++----------------- 3 files changed, 6 insertions(+), 28 deletions(-) diff --git a/src/api/controllers/admin/reporting-controller.ts b/src/api/controllers/admin/reporting-controller.ts index 21fdc797..a54cd2c6 100644 --- a/src/api/controllers/admin/reporting-controller.ts +++ b/src/api/controllers/admin/reporting-controller.ts @@ -239,8 +239,7 @@ export default class ReportingController extends BaseController { } async runNars2023DisabilityReport() { - let academic_year_id = parseInt(this.request.params.academic_year_id ?? moment().format("YYYY")); - return ReportingService.runNars2023DisabilityReport({ format: this.format, academic_year_id }).then( + return ReportingService.runNars2023DisabilityReport({ format: this.format, academic_year_id: 2023 }).then( (reportData) => { if (this.format == "html") { this.response.send(reportData); @@ -266,8 +265,7 @@ export default class ReportingController extends BaseController { } async runNars2023DisabilityRCLReport() { - let academic_year_id = parseInt(this.request.params.academic_year_id ?? moment().format("YYYY")); - return ReportingService.runNars2023DisabilityRCLReport({ format: this.format, academic_year_id }).then( + return ReportingService.runNars2023DisabilityRCLReport({ format: this.format, academic_year_id: 2023 }).then( (reportData) => { if (this.format == "html") { this.response.send(reportData); diff --git a/src/api/routes/admin/index.ts b/src/api/routes/admin/index.ts index b1b1bb27..c567e90e 100644 --- a/src/api/routes/admin/index.ts +++ b/src/api/routes/admin/index.ts @@ -178,8 +178,8 @@ adminRouter.use("/reporting/nars2022disrcl/:academic_year_id", routedTo(Reportin adminRouter.use("/reporting/nars2023", routedTo(ReportingController, "runNars2023FTReport")); adminRouter.use("/reporting/nars2023pt", routedTo(ReportingController, "runNars2023PTReport")); -adminRouter.use("/reporting/nars2023dis/:academic_year_id", routedTo(ReportingController, "runNars2023DisabilityReport")); -adminRouter.use("/reporting/nars2023disrcl/:academic_year_id", routedTo(ReportingController, "runNars2023DisabilityRCLReport")); +adminRouter.use("/reporting/nars2023dis", routedTo(ReportingController, "runNars2023DisabilityReport")); +adminRouter.use("/reporting/nars2023disrcl", routedTo(ReportingController, "runNars2023DisabilityRCLReport")); adminRouter.use("/reporting/step/:academic_year_id", routedTo(ReportingController, "runStepReport")); adminRouter.use("/reporting/approvedFunding/:academic_year_id", routedTo(ReportingController, "runApprovedFundingReport")); diff --git a/src/web/src/modules/Administration/store/ReportsStore.js b/src/web/src/modules/Administration/store/ReportsStore.js index 9dfb8545..af764df9 100644 --- a/src/web/src/modules/Administration/store/ReportsStore.js +++ b/src/web/src/modules/Administration/store/ReportsStore.js @@ -497,18 +497,8 @@ const state = { }, { text: "NARS Disability FT & PT 2023", - url: "/nars2023dis/:academic_year_id", + url: "/nars2023dis", downloadFormat: [".csv", ".txt"], - parameters: [ - { - name: "Academic year", - field: "academic_year_id", - options: "academicYears", - required: true, - itemText: "year", - itemValue: "year", - }, - ], headers: [ { text: "sin", value: "sin" }, { text: "last_name", value: "last_name" }, @@ -540,17 +530,7 @@ const state = { }, { text: "NARS Disability FT - Reduced Course Load 2023", - url: "/nars2023disrcl/:academic_year_id", - parameters: [ - { - name: "Academic year", - field: "academic_year_id", - options: "academicYears", - required: true, - itemText: "year", - itemValue: "year", - }, - ], + url: "/nars2023disrcl", downloadFormat: [".csv", ".txt"], headers: [ { text: "loanyear", value: "loanyear" }, From 874b3c1c9da431331f27f4c8c946e441ede99231 Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Wed, 13 Nov 2024 14:59:27 -0700 Subject: [PATCH 2/2] fix incorrect hard-coded year --- src/api/services/admin/reporting-service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/services/admin/reporting-service.ts b/src/api/services/admin/reporting-service.ts index abe38c3b..21ba9d76 100644 --- a/src/api/services/admin/reporting-service.ts +++ b/src/api/services/admin/reporting-service.ts @@ -233,7 +233,7 @@ export default class ReportingService { let service = new NarsPTReportingService({ startDate: new Date("2023-06-01"), endDate: new Date("2024-05-31"), - year: 2022, + year: 2023, }); let results = await service.runReport();