mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
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>
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user