mirror of
https://github.com/outline/outline.git
synced 2026-11-21 21:44:30 +03:00
fix: 'New draft' from command menu leads to 'Not found' (#11316)
This commit is contained in:
1 parent
2c3650ec4f
commit
ee2054f333
2 files changed
+13
-7
No files matched your search
@@ -79,7 +79,8 @@ function DocumentNew({ template }: Props) {
|
||||
}
|
||||
|
||||
void createDocument();
|
||||
});
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Flex column auto>
|
||||
|
||||
@@ -113,13 +113,19 @@ export function newDocumentPath(
|
||||
templateId?: string;
|
||||
} = {}
|
||||
): string {
|
||||
const search = queryString.stringify(params);
|
||||
|
||||
return collectionId
|
||||
? `/collection/${collectionId}/new?${queryString.stringify(params)}`
|
||||
: `/doc/new?${queryString.stringify(params)}`;
|
||||
? `/collection/${collectionId}/new${search ? `?${search}` : ""}`
|
||||
: `/doc/new${search ? `?${search}` : ""}`;
|
||||
}
|
||||
|
||||
export function newNestedDocumentPath(parentDocumentId?: string): string {
|
||||
return `/doc/new?${queryString.stringify({ parentDocumentId })}`;
|
||||
const search = parentDocumentId
|
||||
? `?${queryString.stringify({ parentDocumentId })}`
|
||||
: "";
|
||||
|
||||
return `/doc/new${search}`;
|
||||
}
|
||||
|
||||
export function searchPath({
|
||||
@@ -133,15 +139,14 @@ export function searchPath({
|
||||
documentId?: string;
|
||||
ref?: string;
|
||||
} = {}): string {
|
||||
let search = queryString.stringify({
|
||||
const search = queryString.stringify({
|
||||
q: query,
|
||||
collectionId,
|
||||
documentId,
|
||||
ref,
|
||||
});
|
||||
|
||||
search = search ? `?${search}` : "";
|
||||
return `/search${search}`;
|
||||
return `/search${search ? `?${search}` : ""}`;
|
||||
}
|
||||
|
||||
export function sharedModelPath(shareId: string, modelPath?: string) {
|
||||
|
||||
Reference in new issue
Block a user