Home / Function/ DeleteQueue() — supabase Function Reference

DeleteQueue() — supabase Function Reference

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

Entity Profile

Relationship Graph

Source Code

apps/studio/components/interfaces/Integrations/Queues/SingleQueue/DeleteQueue.tsx lines 14–60

export const DeleteQueue = ({ queueName, visible, onClose }: DeleteQueueProps) => {
  const router = useRouter()
  const { data: project } = useSelectedProjectQuery()

  const { mutate: deleteDatabaseQueue, isPending } = useDatabaseQueueDeleteMutation({
    onSuccess: () => {
      toast.success(`Successfully removed queue ${queueName}`)
      router.push(`/project/${project?.ref}/integrations/queues/queues`)
      onClose()
    },
  })

  async function handleDelete() {
    if (!project) return console.error('Project is required')

    deleteDatabaseQueue({
      queueName: queueName,
      projectRef: project.ref,
      connectionString: project.connectionString,
    })
  }

  if (!queueName) {
    return null
  }

  return (
    <TextConfirmModal
      variant="destructive"
      visible={visible}
      onCancel={() => onClose()}
      onConfirm={handleDelete}
      title="Delete this queue"
      loading={isPending}
      confirmLabel={`Delete queue ${queueName}`}
      confirmPlaceholder="Type in name of queue"
      confirmString={queueName ?? 'Unknown'}
      text={
        <>
          <span>This will delete the queue</span>{' '}
          <span className="text-bold text-foreground">{queueName}</span>
        </>
      }
      alert={{ title: 'You cannot recover this queue and its messages once deleted.' }}
    />
  )
}

Subdomains

Analyze Your Own Codebase

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

Try Supermodel Free