mirror of
https://github.com/documenso/documenso.git
synced 2025-11-18 10:42:01 +10:00
feat: add folders (#1711)
This commit is contained in:
@ -45,13 +45,20 @@ export async function loader({ params, request }: Route.LoaderArgs) {
|
||||
throw redirect(templateRootPath);
|
||||
}
|
||||
|
||||
if (template.folderId) {
|
||||
throw redirect(`${templateRootPath}/f/${template.folderId}/${templateId}/edit`);
|
||||
}
|
||||
|
||||
const isTemplateEnterprise = await isUserEnterprise({
|
||||
userId: user.id,
|
||||
teamId: team?.id,
|
||||
});
|
||||
|
||||
return superLoaderJson({
|
||||
template,
|
||||
template: {
|
||||
...template,
|
||||
folder: null,
|
||||
},
|
||||
isTemplateEnterprise,
|
||||
templateRootPath,
|
||||
});
|
||||
@ -65,7 +72,11 @@ export default function TemplateEditPage() {
|
||||
<div className="flex flex-col justify-between sm:flex-row">
|
||||
<div>
|
||||
<Link
|
||||
to={`${templateRootPath}/${template.id}`}
|
||||
to={
|
||||
template.folderId
|
||||
? `${templateRootPath}/f/${template.folderId}/${template.id}`
|
||||
: `${templateRootPath}/${template.id}`
|
||||
}
|
||||
className="flex items-center text-[#7AC455] hover:opacity-80"
|
||||
>
|
||||
<ChevronLeft className="mr-2 inline-block h-5 w-5" />
|
||||
|
||||
Reference in New Issue
Block a user