Home / Function/ DeleteWrapperModal() — supabase Function Reference

DeleteWrapperModal() — supabase Function Reference

Architecture documentation for the DeleteWrapperModal() function in DeleteWrapperModal.tsx from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  e613d75b_09b1_75c0_4150_509ca0561b4d["DeleteWrapperModal()"]
  15f32987_269a_4a66_c2fe_0ea97374e22e["getWrapperMetaForWrapper()"]
  e613d75b_09b1_75c0_4150_509ca0561b4d -->|calls| 15f32987_269a_4a66_c2fe_0ea97374e22e
  style e613d75b_09b1_75c0_4150_509ca0561b4d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/studio/components/interfaces/Integrations/Wrappers/DeleteWrapperModal.tsx lines 16–70

const DeleteWrapperModal = ({
  selectedWrapper,
  onClose,
  deletingWrapperIdRef,
}: DeleteWrapperModalProps) => {
  const { data: project } = useSelectedProjectQuery()
  const { mutate: deleteFDW, isPending: isDeleting } = useFDWDeleteMutation({
    onSuccess: () => {
      toast.success(`Successfully disabled ${selectedWrapper?.name} foreign data wrapper`)
      onClose()
    },
    onError: () => {
      if (deletingWrapperIdRef) {
        deletingWrapperIdRef.current = null
      }
    },
  })
  const wrapperMeta = getWrapperMetaForWrapper(selectedWrapper)

  const onConfirmDelete = async () => {
    if (!project?.ref) return console.error('Project ref is required')
    if (!selectedWrapper) return console.error('Wrapper is required')
    if (!wrapperMeta) return console.error('Wrapper meta is required')

    if (deletingWrapperIdRef) {
      deletingWrapperIdRef.current = selectedWrapper.id.toString()
    }

    deleteFDW({
      projectRef: project?.ref,
      connectionString: project?.connectionString,
      wrapper: selectedWrapper,
      wrapperMeta: wrapperMeta,
    })
  }

  return (
    <Modal
      size="medium"
      alignFooter="right"
      loading={isDeleting}
      visible={selectedWrapper !== undefined}
      onCancel={() => onClose()}
      onConfirm={() => onConfirmDelete()}
      header={`Confirm to disable ${selectedWrapper?.name}`}
    >
      <Modal.Content>
        <p className="text-sm">
          Are you sure you want to disable {selectedWrapper?.name}? This will also remove all tables
          created with this wrapper.
        </p>
      </Modal.Content>
    </Modal>
  )
}

Subdomains

Frequently Asked Questions

What does DeleteWrapperModal() do?
DeleteWrapperModal() is a function in the supabase codebase.
What does DeleteWrapperModal() call?
DeleteWrapperModal() calls 1 function(s): getWrapperMetaForWrapper.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free