Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
df63b0a
backend setup
superhvarn Oct 15, 2025
3acd65f
hooks
superhvarn Oct 16, 2025
437803a
#3629 frontend changes for CAR
superhvarn Dec 6, 2025
936b908
#3629 tests pass
superhvarn Dec 7, 2025
c098546
#3811 fixing frontend tests
superhvarn Dec 7, 2025
d2c8cff
#3629 fixing sidebar
superhvarn Dec 7, 2025
404f6fe
Merge branch 'develop' into 3629-maintenance---global-finance-filtering
superhvarn Dec 7, 2025
9da7ea5
#3629 fixing finance dashboard
superhvarn Dec 7, 2025
7b68b50
3629 fixing dropdown sidebar UI
superhvarn Dec 7, 2025
41af049
#3629 linting
superhvarn Dec 7, 2025
564fdd8
#3629 linting
superhvarn Dec 7, 2025
5d677ed
filtering for other data
superhvarn Dec 7, 2025
6489d20
Merging main into branch
Steph375 Feb 4, 2026
8b007f8
#3950 getAllProjects
Feb 12, 2026
4c24a7a
#3950 fixed api function
Feb 12, 2026
356617a
#3948 update work-packages.services.ts
patriots1 Feb 13, 2026
05959a9
#3950 modified endpoints to include optional car id
Feb 16, 2026
14d52b6
#3950 docs for car filtering
Feb 16, 2026
5d21f7c
#3950 udpated endpoint to use middleware to get car info
Feb 25, 2026
00255a9
#3948 update work-packages.controllers.ts
patriots1 Feb 28, 2026
931b46e
#3948 refactor work-packages-services.ts
patriots1 Mar 1, 2026
6cbafec
#3948 refactor work-packages.controllers.ts
patriots1 Mar 1, 2026
1e21595
#3948 update work-packages.routes.ts
patriots1 Mar 1, 2026
a1c1ed0
Merge pull request #3975 from Northeastern-Electric-Racing/#3950-getA…
chpy04 Mar 4, 2026
14754fb
connecting carId with frontend
Steph375 Mar 6, 2026
739a001
Merge pull request #4012 from Northeastern-Electric-Racing/4011-carid
Steph375 Mar 6, 2026
1d1530c
Merge branch 'feature/global-car-filtering' into #3948-update-getWork…
patriots1 Mar 7, 2026
db22b43
#3948 update controller and service
patriots1 Mar 7, 2026
5052439
Merge branch 'develop' into feature/global-car-filtering
cielbellerose Mar 10, 2026
fc0bf21
merge with feature branch
chpy04 Mar 11, 2026
18b63f4
remove carid from route validation
chpy04 Mar 11, 2026
025d867
added back status query route validation
chpy04 Mar 11, 2026
8e28487
Merge pull request #4005 from Northeastern-Electric-Racing/#3948-upda…
chpy04 Mar 11, 2026
0f2c0ee
Merge branch 'develop' into feature/global-car-filtering
chpy04 Mar 14, 2026
9ea3dd9
refactor: modify queries to include selectedCar key, remove redundant…
rbessin Mar 19, 2026
85de9c1
test: fix wrapper to include global car filter
rbessin Mar 19, 2026
5c24507
feat: add car filtering to change requests endpoints and overview
rbessin Mar 21, 2026
1956725
fix: correct first load car filtering and simplify initialization logic
rbessin Mar 21, 2026
1dfd631
fix: resolve failing tests and type errors from global car filter
rbessin Mar 21, 2026
21577b3
fix: resolve failing tests for projects + work packages
rbessin Mar 21, 2026
33b1f13
fix: set Fergus car filter in cy.login for e2e tests
rbessin Mar 21, 2026
5ad72df
fix: update Fergus car filter in e2e login to use backend cars endpoint
rbessin Mar 21, 2026
1d9b9ae
fix: move seed data to NER-25 and fix change request car filtering fo…
rbessin Mar 21, 2026
941ddd6
style: fix styling issue
rbessin Mar 21, 2026
b1894f9
fix: default new project car to globally selected car
rbessin Mar 21, 2026
54d2f95
Merge remote-tracking branch 'origin/develop' into feature/global-car…
rbessin Mar 21, 2026
b5b5b83
refactor: autopopulate project forms with global car filter
rbessin Mar 21, 2026
8ace462
feat: fix stale car filter and add all cars selection option
rbessin Mar 22, 2026
1faa056
feat: show car selector in project form when global filter is 'all cars'
rbessin Mar 22, 2026
99837c4
fix: mock car filter in unit tests and restore it in e2e login
rbessin Mar 22, 2026
1201456
feat: sync gantt car filter with global selection and filter projects…
rbessin Mar 23, 2026
c7f310a
style: fix prettier styling in ProjectGanttChartPage
rbessin Mar 23, 2026
ebd0ad9
feat: replace skipCarFilter with overrideCarId and persist car select…
rbessin Mar 24, 2026
1cf7b35
fix: update tests for localStorage car ID
rbessin Mar 24, 2026
8788976
feat: include wbsElement in getCurrentCar middleware for carNumber ac…
rbessin Mar 24, 2026
efd4c17
feat: read carNumber from middleware in finance controllers
rbessin Mar 24, 2026
49ed4ec
fix: wrap dates in new Date() across url builders to handle string in…
rbessin Mar 24, 2026
56b3628
favorites car filtering: filter by car id in backend instead of frontend
nunnyu Mar 25, 2026
11e7501
GlobalCarFilterDropdown repositioning on Sidebar
nunnyu Mar 25, 2026
020bf87
changed GlobalCarFilterDropdown so it is always expanded
nunnyu Mar 25, 2026
67ecd1c
feat(finance): add local car filter with date auto-population to fina…
rbessin Mar 26, 2026
bdf0d34
Merge branch 'feature/global-car-filtering' of github.com:Northeaster…
rbessin Mar 26, 2026
8a926da
style: fix prettier issues on AdminFinanceDashboard and FinanceDashbo…
rbessin Mar 26, 2026
5cc4cec
fix: updated parameter types to be more specific
rbessin Mar 28, 2026
6b3db57
docs: added comments to clarify carNumber usage, Gantt chart local fi…
rbessin Mar 28, 2026
c314316
refactor: remove dead GET /cars/current endpoint and useGetCurrentCar…
rbessin Mar 28, 2026
189d41f
chore: delete dead usePageCarFilter hook
rbessin Mar 29, 2026
0117232
fix: add wbsNum to cache keys for unreviewed and approved change requ…
rbessin Mar 29, 2026
bae565c
style: fix prettier formatting in change-requests.hooks.ts
rbessin Mar 29, 2026
8000e05
chore: removed unused car reference
rbessin Mar 29, 2026
59c7368
refactor: remove dead non-compact mode and optimize code
rbessin Mar 29, 2026
44dd1ca
fix: inline setSelectedCar body in initialization effect to satisfy e…
rbessin Mar 29, 2026
b609929
chore: remove unused Car import
rbessin Mar 29, 2026
78bc7d8
fix: move carId filter to work_Package level in getAllWorkPackagesPre…
rbessin Mar 29, 2026
1630323
test: getCurrentCar middleware and updated change request query methods
rbessin Mar 29, 2026
e6e3c2a
test: increased test timeout to allow time for db calls
rbessin Mar 29, 2026
bb7d499
fix: prevent startup flash of unfiltered data and header/state desync…
rbessin Mar 30, 2026
67f1c89
style: fixed linting error due to destructuring queries
rbessin Mar 30, 2026
230bbbe
fix: add organization filter to car retrieval in middleware
rbessin Mar 30, 2026
77a2234
fix: exclude guests from user selection dropdowns
rbessin Mar 30, 2026
f1f1182
test: fixed req to include organization in car tests
rbessin Mar 30, 2026
67b18e2
Merge branch 'develop' into feature/global-car-filtering
rbessin Mar 30, 2026
52a79e8
fix: merge issues related to user fetching
rbessin Mar 30, 2026
5d0a3f9
test: fix timing issue related to work package tests
rbessin Mar 31, 2026
5f6fc53
refactor: apply carId filter during Prisma traversal in getBlockingWo…
rbessin Mar 31, 2026
a13a7bd
refactor: reorder createTestProject/createTestWorkPackage params to c…
rbessin Mar 31, 2026
1454bfd
fix: pass startDate, endDate, and carNumber through getSpendingBarCat…
rbessin Apr 2, 2026
42c2aa6
style: fix prettier styling for finance.services.ts
rbessin Apr 2, 2026
535a73b
test: refactor tests to use createTestCar helper method
rbessin Apr 2, 2026
f4646f6
feat: filter reimbursement request list endpoints by global car selec…
rbessin Apr 2, 2026
9618c4a
style(finance): fix prettier formatting on finance.hooks.ts
rbessin Apr 2, 2026
6c61198
test: add car filtering and carNumber 0 regression tests for reimburs…
rbessin Apr 2, 2026
3de2c8c
Merge remote-tracking branch 'origin/develop' into feature/global-car…
rbessin Apr 6, 2026
d8ad134
fix: comment placement, carNumber null handling, and global car filte…
rbessin Apr 6, 2026
be6e0dc
fix: getManyWorkPackages and getBlockingWorkPackages to not take in c…
rbessin Apr 6, 2026
3c3872e
refactor: getAllWorkPackages to pass carId as explicit arg instead of…
rbessin Apr 6, 2026
889b1ee
refactor: replace null with 'all-cars' sentinel in car filter
rbessin Apr 7, 2026
6c6baea
style: fix prettier issues on multiple files
rbessin Apr 7, 2026
8262627
fix: name display issue
rbessin Apr 7, 2026
ea12487
Merge branch 'develop' into feature/global-car-filtering
chpy04 Apr 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/backend/custom.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Organization } from '@prisma/client';
import { Organization, Prisma } from '@prisma/client';
import { User as SharedUser } from 'shared';

declare global {
namespace Express {
export interface Request {
currentUser: SharedUser;
organization: Organization;
currentCar?: Prisma.CarGetPayload<{ include: { wbsElement: true } }>;
}
}
}
4 changes: 4 additions & 0 deletions src/backend/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import cors from 'cors';
import cookieParser from 'cookie-parser';
import { getUserAndOrganization, prodHeaders, requireJwtDev, requireJwtProd } from './src/utils/auth.utils.js';
import { errorHandler } from './src/utils/errors.utils.js';
import { getCurrentCar } from './src/utils/car.utils.js';
import userRouter from './src/routes/users.routes.js';
import projectRouter from './src/routes/projects.routes.js';
import teamsRouter from './src/routes/teams.routes.js';
Expand Down Expand Up @@ -90,6 +91,9 @@ app.use(isProd ? requireJwtProd : requireJwtDev);
// get user and organization
app.use(getUserAndOrganization);

// get current car
app.use(getCurrentCar);

// routes
app.use('/users', userRouter);
app.use('/projects', projectRouter);
Expand Down
14 changes: 10 additions & 4 deletions src/backend/src/controllers/change-requests.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default class ChangeRequestsController {

static async getAllChangeRequests(req: Request, res: Response, next: NextFunction) {
try {
const changeRequests = await ChangeRequestsService.getAllChangeRequests(req.organization);
const changeRequests = await ChangeRequestsService.getAllChangeRequests(req.organization, req.currentCar?.carId);
res.status(200).json(changeRequests);
} catch (error: unknown) {
next(error);
Expand All @@ -34,7 +34,11 @@ export default class ChangeRequestsController {

static async getToReviewChangeRequests(req: Request, res: Response, next: NextFunction) {
try {
const changeRequests = await ChangeRequestsService.getToReviewChangeRequests(req.currentUser, req.organization);
const changeRequests = await ChangeRequestsService.getToReviewChangeRequests(
req.currentUser,
req.organization,
req.currentCar?.carId
);
res.status(200).json(changeRequests);
} catch (error: unknown) {
next(error);
Expand All @@ -50,7 +54,8 @@ export default class ChangeRequestsController {
const changeRequests = await ChangeRequestsService.getUnreviewedChangeRequests(
req.currentUser,
validatedWbs,
req.organization
req.organization,
req.currentCar?.carId
);
res.status(200).json(changeRequests);
} catch (error: unknown) {
Expand All @@ -67,7 +72,8 @@ export default class ChangeRequestsController {
const changeRequests = await ChangeRequestsService.getApprovedChangeRequests(
req.currentUser,
validatedWbs,
req.organization
req.organization,
req.currentCar?.carId
);
res.status(200).json(changeRequests);
} catch (error: unknown) {
Expand Down
54 changes: 32 additions & 22 deletions src/backend/src/controllers/finance.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,17 @@ export default class FinanceController {
static async getReimbursementRequestTeamData(req: Request, res: Response, next: NextFunction) {
try {
const { teamId } = req.params as Record<string, string>;
const { startDate, endDate, carNumber } = req.query;
const { startDate, endDate } = req.query;
const parsedStartDate = typeof startDate === 'string' ? new Date(startDate) : undefined;
const parsedEndDate = typeof endDate === 'string' ? new Date(endDate) : undefined;
const parsedCarNumber = typeof carNumber === 'string' ? Number(carNumber) : undefined;
const carNumber = req.currentCar?.wbsElement.carNumber;

const rrData = await FinanceServices.getReimbursementRequestTeamData(
req.organization,
teamId,
parsedStartDate,
parsedEndDate,
parsedCarNumber
carNumber
);
res.status(200).json(rrData);
} catch (error: unknown) {
Expand All @@ -193,17 +193,17 @@ export default class FinanceController {
static async getReimbursementRequestTeamTypeData(req: Request, res: Response, next: NextFunction) {
try {
const { teamTypeId } = req.params as Record<string, string>;
const { startDate, endDate, carNumber } = req.query;
const { startDate, endDate } = req.query;
const parsedStartDate = typeof startDate === 'string' ? new Date(startDate) : undefined;
const parsedEndDate = typeof endDate === 'string' ? new Date(endDate) : undefined;
const parsedCarNumber = typeof carNumber === 'string' ? Number(carNumber) : undefined;
const carNumber = req.currentCar?.wbsElement.carNumber;

const rrData = await FinanceServices.getReimbursementRequestTeamTypeData(
req.organization,
teamTypeId,
parsedStartDate,
parsedEndDate,
parsedCarNumber
carNumber
);
res.status(200).json(rrData);
} catch (error: unknown) {
Expand All @@ -214,17 +214,17 @@ export default class FinanceController {
static async getSpendingBarTeamData(req: Request, res: Response, next: NextFunction) {
try {
const { teamId } = req.params as Record<string, string>;
const { startDate, endDate, carNumber } = req.query;
const { startDate, endDate } = req.query;
const parsedStartDate = typeof startDate === 'string' ? new Date(startDate) : undefined;
const parsedEndDate = typeof endDate === 'string' ? new Date(endDate) : undefined;
const parsedCarNumber = typeof carNumber === 'string' ? Number(carNumber) : undefined;
const carNumber = req.currentCar?.wbsElement.carNumber;

const spendingBarData = await FinanceServices.getSpendingBarTeamData(
req.organization,
teamId,
parsedStartDate,
parsedEndDate,
parsedCarNumber
carNumber
);
res.status(200).json(spendingBarData);
} catch (error: unknown) {
Expand All @@ -235,17 +235,17 @@ export default class FinanceController {
static async getSpendingBarTeamTypeData(req: Request, res: Response, next: NextFunction) {
try {
const { teamTypeId } = req.params as Record<string, string>;
const { startDate, endDate, carNumber } = req.query;
const { startDate, endDate } = req.query;
const parsedStartDate = typeof startDate === 'string' ? new Date(startDate) : undefined;
const parsedEndDate = typeof endDate === 'string' ? new Date(endDate) : undefined;
const parsedCarNumber = typeof carNumber === 'string' ? Number(carNumber) : undefined;
const carNumber = req.currentCar?.wbsElement.carNumber;

const spendingBarData = await FinanceServices.getSpendingBarTeamTypeData(
req.organization,
teamTypeId,
parsedStartDate,
parsedEndDate,
parsedCarNumber
carNumber
);
res.status(200).json(spendingBarData);
} catch (error: unknown) {
Expand All @@ -255,16 +255,16 @@ export default class FinanceController {

static async getAllReimbursementRequestData(req: Request, res: Response, next: NextFunction) {
try {
const { startDate, endDate, carNumber } = req.query;
const { startDate, endDate } = req.query;
const parsedStartDate = typeof startDate === 'string' ? new Date(startDate) : undefined;
const parsedEndDate = typeof endDate === 'string' ? new Date(endDate) : undefined;
const parsedCarNumber = typeof carNumber === 'string' ? Number(carNumber) : undefined;
const carNumber = req.currentCar?.wbsElement.carNumber;

const rrData = await FinanceServices.getAllReimbursementRequestData(
req.organization,
parsedStartDate,
parsedEndDate,
parsedCarNumber
carNumber
);
res.status(200).json(rrData);
} catch (error: unknown) {
Expand All @@ -275,17 +275,17 @@ export default class FinanceController {
static async getReimbursementRequestCategoryData(req: Request, res: Response, next: NextFunction) {
try {
const { otherReasonId } = req.params as Record<string, string>;
const { startDate, endDate, carNumber } = req.query;
const { startDate, endDate } = req.query;
const parsedStartDate = typeof startDate === 'string' ? new Date(startDate) : undefined;
const parsedEndDate = typeof endDate === 'string' ? new Date(endDate) : undefined;
const parsedCarNumber = typeof carNumber === 'string' ? Number(carNumber) : undefined;
const carNumber = req.currentCar?.wbsElement.carNumber;

const rrData = await FinanceServices.getReimbursementRequestCategoryData(
otherReasonId,
req.organization,
parsedStartDate,
parsedEndDate,
parsedCarNumber
carNumber
);
res.status(200).json(rrData);
} catch (error: unknown) {
Expand All @@ -295,16 +295,16 @@ export default class FinanceController {

static async getAllSpendingBarData(req: Request, res: Response, next: NextFunction) {
try {
const { startDate, endDate, carNumber } = req.query;
const { startDate, endDate } = req.query;
const parsedStartDate = typeof startDate === 'string' ? new Date(startDate) : undefined;
const parsedEndDate = typeof endDate === 'string' ? new Date(endDate) : undefined;
const parsedCarNumber = typeof carNumber === 'string' ? Number(carNumber) : undefined;
const carNumber = req.currentCar?.wbsElement.carNumber;

const spendingBarData = await FinanceServices.getAllSpendingBarData(
req.organization,
parsedStartDate,
parsedEndDate,
parsedCarNumber
carNumber
);
res.status(200).json(spendingBarData);
} catch (error: unknown) {
Expand All @@ -314,7 +314,17 @@ export default class FinanceController {

static async getSpendingBarCategoryData(req: Request, res: Response, next: NextFunction) {
try {
const spendingBarData = await FinanceServices.getSpendingBarCategoryData(req.organization);
const { startDate, endDate } = req.query;
const parsedStartDate = typeof startDate === 'string' ? new Date(startDate) : undefined;
const parsedEndDate = typeof endDate === 'string' ? new Date(endDate) : undefined;
const carNumber = req.currentCar?.wbsElement.carNumber;

const spendingBarData = await FinanceServices.getSpendingBarCategoryData(
req.organization,
parsedStartDate,
parsedEndDate,
carNumber
);
res.status(200).json(spendingBarData);
} catch (error: unknown) {
next(error);
Expand Down
18 changes: 13 additions & 5 deletions src/backend/src/controllers/projects.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import BillOfMaterialsService from '../services/boms.services.js';
export default class ProjectsController {
static async getAllProjectsGantt(req: Request, res: Response, next: NextFunction) {
try {
const projects: ProjectGantt[] = await ProjectsService.getAllProjectsGantt(req.organization);
const projects: ProjectGantt[] = await ProjectsService.getAllProjectsGantt(req.organization, req.currentCar?.carId);
res.status(200).json(projects);
} catch (error: unknown) {
next(error);
Expand All @@ -25,7 +25,7 @@ export default class ProjectsController {

static async getAllProjects(req: Request, res: Response, next: NextFunction) {
try {
const projects: ProjectPreview[] = await ProjectsService.getAllProjects(req.organization);
const projects: ProjectPreview[] = await ProjectsService.getAllProjects(req.organization, req.currentCar?.carId);
res.status(200).json(projects);
} catch (error: unknown) {
next(error);
Expand All @@ -34,7 +34,11 @@ export default class ProjectsController {

static async getUsersTeamsProjects(req: Request, res: Response, next: NextFunction) {
try {
const projects: ProjectOverview[] = await ProjectsService.getUsersTeamsProjects(req.currentUser, req.organization);
const projects: ProjectOverview[] = await ProjectsService.getUsersTeamsProjects(
req.currentUser,
req.organization,
req.currentCar?.carId
);
res.status(200).json(projects);
} catch (error: unknown) {
next(error);
Expand All @@ -43,7 +47,11 @@ export default class ProjectsController {

static async getUsersLeadingProjects(req: Request, res: Response, next: NextFunction) {
try {
const projects: ProjectOverview[] = await ProjectsService.getUsersLeadingProjects(req.currentUser, req.organization);
const projects: ProjectOverview[] = await ProjectsService.getUsersLeadingProjects(
req.currentUser,
req.organization,
req.currentCar?.carId
);
res.status(200).json(projects);
} catch (error: unknown) {
next(error);
Expand All @@ -53,7 +61,7 @@ export default class ProjectsController {
static async getTeamsProjects(req: Request, res: Response, next: NextFunction) {
try {
const { teamId } = req.params as Record<string, string>;
const projects: Project[] = await ProjectsService.getTeamsProjects(req.organization, teamId);
const projects: Project[] = await ProjectsService.getTeamsProjects(req.organization, teamId, req.currentCar?.carId);
res.status(200).json(projects);
} catch (error: unknown) {
next(error);
Expand Down
20 changes: 15 additions & 5 deletions src/backend/src/controllers/reimbursement-requests.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ import { HttpException } from '../utils/errors.utils.js';
export default class ReimbursementRequestsController {
static async getCurrentUserReimbursementRequests(req: Request, res: Response, next: NextFunction) {
try {
const carNumber = req.currentCar?.wbsElement.carNumber;
const userReimbursementRequests = await ReimbursementRequestService.getUserReimbursementRequests(
req.currentUser,
req.organization
req.organization,
carNumber
);
res.status(200).json(userReimbursementRequests);
} catch (error: unknown) {
Expand All @@ -25,9 +27,11 @@ export default class ReimbursementRequestsController {

static async getCurrentUserAssignedReimbursementRequests(req: Request, res: Response, next: NextFunction) {
try {
const carNumber = req.currentCar?.wbsElement.carNumber;
const assignedReimbursementRequests = await ReimbursementRequestService.getUserAssignedReimbursementRequests(
req.currentUser,
req.organization
req.organization,
carNumber
);
res.status(200).json(assignedReimbursementRequests);
} catch (error: unknown) {
Expand All @@ -46,9 +50,11 @@ export default class ReimbursementRequestsController {

static async getCurrentUsersTeamsReimbursementRequests(req: Request, res: Response, next: NextFunction) {
try {
const carNumber = req.currentCar?.wbsElement.carNumber;
const userTeamsReimbursementRequests = await ReimbursementRequestService.getUsersTeamsReimbursementRequests(
req.currentUser,
req.organization
req.organization,
carNumber
);
res.status(200).json(userTeamsReimbursementRequests);
} catch (error: unknown) {
Expand Down Expand Up @@ -208,9 +214,11 @@ export default class ReimbursementRequestsController {

static async getPendingAdvisorList(req: Request, res: Response, next: NextFunction) {
try {
const carNumber = req.currentCar?.wbsElement.carNumber;
const requestsPendingAdvisors: ReimbursementRequest[] = await ReimbursementRequestService.getPendingAdvisorList(
req.currentUser,
req.organization
req.organization,
carNumber
);
res.status(200).json(requestsPendingAdvisors);
} catch (error: unknown) {
Expand Down Expand Up @@ -308,9 +316,11 @@ export default class ReimbursementRequestsController {

static async getAllReimbursementRequests(req: Request, res: Response, next: NextFunction) {
try {
const carNumber = req.currentCar?.wbsElement.carNumber;
const reimbursementRequests: ReimbursementRequest[] = await ReimbursementRequestService.getAllReimbursementRequests(
req.currentUser,
req.organization
req.organization,
carNumber
);
res.status(200).json(reimbursementRequests);
} catch (error: unknown) {
Expand Down
6 changes: 5 additions & 1 deletion src/backend/src/controllers/users.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ export default class UsersController {

static async getUsersFavoriteProjects(req: Request, res: Response, next: NextFunction) {
try {
const projects = await UsersService.getUsersFavoriteProjects(req.currentUser.userId, req.organization);
const projects = await UsersService.getUsersFavoriteProjects(
req.currentUser.userId,
req.organization,
req.currentCar?.carId
);

res.status(200).json(projects);
} catch (error: unknown) {
Expand Down
Loading
Loading