Leads Controller (leads/index.ts)

Flowise · packages/server/src/controllers/leads/index.ts · typescript · Apache-2.0
database, crm, fw:express, tag:chatflows, tag:workspace

Handles lead data retrieval for chatflows in Flowise, ensuring workspace validation.

// Source: https://github.com/FlowiseAI/Flowise | License: Apache-2.0 | Copyright 2023-present FlowiseAI, Inc
// Provided via justclaw.it.com; keep this notice with the code.
import { Request, Response, NextFunction } from 'express'
import chatflowsService from '../../services/chatflows'
import leadsService from '../../services/leads'
import { StatusCodes } from 'http-status-codes'
import { InternalFlowiseError } from '../../errors/internalFlowiseError'

const getAllLeadsForChatflow = async (req: Request, res: Response, next: NextFunction) => {
    try {
        if (typeof req.params.id === 'undefined' || req.params.id === '') {
            throw new InternalFlowiseError(
                StatusCodes.PRECONDITION_FAILED,
                `Error: leadsController.getAllLeadsForChatflow - id no

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key