diff --git a/components/nodes/NodeVDrawer.tsx b/components/nodes/NodeVDrawer.tsx index d35aa2c..1d17f81 100644 --- a/components/nodes/NodeVDrawer.tsx +++ b/components/nodes/NodeVDrawer.tsx @@ -83,7 +83,7 @@ const NodeVDrawer: React.FC = ({ ) } - if (!version || !version.id || !publisherId) { + if (!version || !version.id) { return null } @@ -202,7 +202,7 @@ const NodeVDrawer: React.FC = ({ onCloseDeleteModal={() => setIsDeleteModalOpen(false)} nodeId={nodeId} versionId={version.id} - publisherId={publisherId} + publisherId={publisherId as string} /> ) diff --git a/components/nodes/NodeVersionDeleteModal.tsx b/components/nodes/NodeVersionDeleteModal.tsx index 35886ed..20f8e65 100644 --- a/components/nodes/NodeVersionDeleteModal.tsx +++ b/components/nodes/NodeVersionDeleteModal.tsx @@ -10,7 +10,7 @@ type NodeVersionDeleteModalProps = { onCloseDeleteModal: () => void nodeId: string versionId: string - publisherId: string + publisherId?: string } export const NodeVersionDeleteModal: React.FC = ({ @@ -23,6 +23,10 @@ export const NodeVersionDeleteModal: React.FC = ({ const deleteVersionMutation = useDeleteNodeVersion({}) const handleDeleteVersion = () => { + if (!publisherId) { + toast.error('Cannot delete version.') + return + } deleteVersionMutation.mutate( { nodeId: nodeId,