Use version id in document redirect
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -13,10 +13,12 @@ const documentTabs = (prefix: string) => {
|
|||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
path: `${prefix}`,
|
path: `${prefix}`,
|
||||||
queryLoader: ({ organizationId, documentId }) => {
|
queryLoader: ({ organizationId, documentId, versionId }) => {
|
||||||
throw redirect(
|
const basePath = `/organizations/${organizationId}/documents/${documentId}`;
|
||||||
`/organizations/${organizationId}/documents/${documentId}/description`,
|
const redirectPath = versionId
|
||||||
);
|
? `${basePath}/versions/${versionId}/description`
|
||||||
|
: `${basePath}/description`;
|
||||||
|
throw redirect(redirectPath);
|
||||||
},
|
},
|
||||||
Component: Fragment,
|
Component: Fragment,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user