From ea9e9675fb99bb7b9b05b8f86ce02a7e7ba0e9ae Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sun, 8 Feb 2026 18:21:06 -0500 Subject: [PATCH] Fix document creation routing to use correct parameter name (#11369) * Initial plan * Fix: Use correct route parameter name in DocumentNew The route parameter is 'collectionSlug', not 'id'. This caused documents created through /collection/:collectionSlug/new to not have a collectionId, making them go to drafts instead of the collection. Co-authored-by: tommoor <380914+tommoor@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tommoor <380914+tommoor@users.noreply.github.com> --- app/scenes/DocumentNew.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/scenes/DocumentNew.tsx b/app/scenes/DocumentNew.tsx index a5fce7543b..a0f91de37c 100644 --- a/app/scenes/DocumentNew.tsx +++ b/app/scenes/DocumentNew.tsx @@ -23,11 +23,11 @@ function DocumentNew({ template }: Props) { const location = useLocation(); const query = useQuery(); const user = useCurrentUser(); - const match = useRouteMatch<{ id?: string }>(); + const match = useRouteMatch<{ collectionSlug?: string }>(); const { t } = useTranslation(); const { documents, collections, userMemberships, groupMemberships } = useStores(); - const id = match.params.id || query.get("collectionId"); + const id = match.params.collectionSlug || query.get("collectionId"); useEffect(() => { async function createDocument() {