diff --git a/src/frontend/src/pages/part/CategoryDetail.tsx b/src/frontend/src/pages/part/CategoryDetail.tsx
index 30f63b6ba4..6a8e07d011 100644
--- a/src/frontend/src/pages/part/CategoryDetail.tsx
+++ b/src/frontend/src/pages/part/CategoryDetail.tsx
@@ -23,7 +23,11 @@ import { useInstance } from '../../hooks/UseInstance';
* Note: If no category ID is supplied, this acts as the top-level part category page
*/
export default function CategoryDetail({}: {}) {
- const { id } = useParams();
+ const { id: _id } = useParams();
+ const id = useMemo(
+ () => (!isNaN(parseInt(_id || '')) ? _id : undefined),
+ [_id]
+ );
const [treeOpen, setTreeOpen] = useState(false);
@@ -33,6 +37,7 @@ export default function CategoryDetail({}: {}) {
instanceQuery
} = useInstance({
endpoint: ApiPaths.category_list,
+ hasPrimaryKey: true,
pk: id,
params: {
path_detail: true
diff --git a/src/frontend/src/pages/stock/LocationDetail.tsx b/src/frontend/src/pages/stock/LocationDetail.tsx
index af55680e8a..8a40a57a06 100644
--- a/src/frontend/src/pages/stock/LocationDetail.tsx
+++ b/src/frontend/src/pages/stock/LocationDetail.tsx
@@ -13,7 +13,12 @@ import { ApiPaths } from '../../enums/ApiEndpoints';
import { useInstance } from '../../hooks/UseInstance';
export default function Stock() {
- const { id } = useParams();
+ const { id: _id } = useParams();
+
+ const id = useMemo(
+ () => (!isNaN(parseInt(_id || '')) ? _id : undefined),
+ [_id]
+ );
const [treeOpen, setTreeOpen] = useState(false);
@@ -23,6 +28,7 @@ export default function Stock() {
instanceQuery
} = useInstance({
endpoint: ApiPaths.stock_location_list,
+ hasPrimaryKey: true,
pk: id,
params: {
path_detail: true
diff --git a/src/frontend/src/router.tsx b/src/frontend/src/router.tsx
index 45713dbe38..dd82991751 100644
--- a/src/frontend/src/router.tsx
+++ b/src/frontend/src/router.tsx
@@ -119,12 +119,12 @@ export const routes = (
} />
- } />
+ } />
} />
} />
- } />
+ } />
} />
} />