UI - Redirect on invalid URL parameter to /software/add/fleet-maintained/:id (#24637)

## #24636

Redirect when NaN "foobar" provided as software id in url:

https://github.com/user-attachments/assets/e1b0ce3d-f494-447c-a452-285f0e6758af

- [x] Changes file added for user-visible changes in `changes/`,
- [x] Manual QA for all new/changed functionality

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
This commit is contained in:
jacobshandling 2024-12-13 10:40:58 -08:00 committed by GitHub
parent fb118b6f35
commit 7e5000cf52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View file

@ -0,0 +1 @@
* Redirect when user provides an invalid URL param for fleet-maintained software id

View file

@ -98,6 +98,9 @@ const FleetMaintainedAppDetailsPage = ({
}: IFleetMaintainedAppDetailsPageProps) => {
const teamId = location.query.team_id;
const appId = parseInt(routeParams.id, 10);
if (isNaN(appId)) {
router.push(PATHS.SOFTWARE_ADD_FLEET_MAINTAINED);
}
const { renderFlash } = useContext(NotificationContext);
const { isPremiumTier } = useContext(AppContext);