The Open Source DocuSign Alternative.
TypeScript digital-signaturedocument-signingdocusign-alternativee-signatureesignesignaturenext-authnextjsopen-sourcepades-standardpdfpdf-signpdf-signaturepostgresqlprismaself-hostedsigningtypescript
fix: handle unauthorized document move error (#1884)
Catalin Pitc47dc8749aa6
diff --git a/apps/remix/app/components/dialogs/document-move-to-folder-dialog.tsx b/apps/remix/app/components/dialogs/document-move-to-folder-dialog.tsxindex e1d58f649..401fb3529 100644--- a/apps/remix/app/components/dialogs/document-move-to-folder-dialog.tsx+++ b/apps/remix/app/components/dialogs/document-move-to-folder-dialog.tsx@@ -127,6 +127,16 @@ export const DocumentMoveToFolderDialog = ({return;}+ if (error.code === AppErrorCode.UNAUTHORIZED) {+ toast({+ title: _(msg`Error`),+ description: _(msg`You are not allowed to move this document.`),+ variant: 'destructive',+ });++ return;+ }+toast({title: _(msg`Error`),description: _(msg`An error occurred while moving the document.`),diff --git a/apps/remix/app/components/tables/documents-table-action-dropdown.tsx b/apps/remix/app/components/tables/documents-table-action-dropdown.tsxindex 0a2d71dfd..1186afb18 100644--- a/apps/remix/app/components/tables/documents-table-action-dropdown.tsx+++ b/apps/remix/app/components/tables/documents-table-action-dropdown.tsx@@ -188,7 +188,7 @@ export const DocumentsTableActionDropdown = ({<Trans>Duplicate</Trans></DropdownMenuItem>- {onMoveDocument && (+ {onMoveDocument && canManageDocument && (<DropdownMenuItem onClick={onMoveDocument} onSelect={(e) => e.preventDefault()}><FolderInput className="mr-2 h-4 w-4" /><Trans>Move to Folder</Trans>