Skip to content

#3948 update get work packages endpoints#4005

Open
patriots1 wants to merge 7 commits intofeature/global-car-filteringfrom
#3948-update-getWorkPackages-Endpoints
Open

#3948 update get work packages endpoints#4005
patriots1 wants to merge 7 commits intofeature/global-car-filteringfrom
#3948-update-getWorkPackages-Endpoints

Conversation

@patriots1
Copy link
Contributor

Changes

Added optional car parameter for filtering to getAllWorkPackages, getManyWorkPackages, getBlockingWorkPackages and getHomePageWorkPackages.

Test Cases

Unable to test due to issues with local machine. Unit test file for work-packages did not exist.

To Do

  • test updated endpoints

Closes #3948

include optional car param for getAllWorkPackages and getManyWorkPackages
enable support of optional car param with getAllWorkPackages and getManyWorkPackages
add optional car param to more methods
make sure optional car param is used
include checks for optional car param
@patriots1 patriots1 self-assigned this Mar 3, 2026
@patriots1 patriots1 marked this pull request as draft March 3, 2026 18:34
@patriots1 patriots1 changed the base branch from develop to feature/global-car-filtering March 3, 2026 18:36
@patriots1 patriots1 marked this pull request as ready for review March 3, 2026 18:37
Copy link
Contributor

@Steph375 Steph375 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just added middleware that sets req.currentCar based on the carId header from the global car filter. Because of that, controllers shouldn't read carId from the request body anymore.

This endpoint can use req.currentCar?.carId instead so it stays consistent with the rest of the controllers. I would look at getAllProjects its doing something similar.

update controller for middleware, fix bug due to type change in service
@patriots1
Copy link
Contributor Author

Refactored controller to match middleware. Service logic was buggy due to changing the type of carId - fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Maintenance Car] - Update getWorkPackages Endpoints

2 participants