wppconnect-team / wppconnect

WPPConnect is an open source project developed by the JavaScript community with the aim of exporting functions from WhatsApp Web to the node, which can be used to support the creation of any interaction, such as customer service, media sending, intelligence recognition based on phrases artificial and many other things, use your imagination
https://wppconnect.io
Other
1.92k stars 338 forks source link

addNewLabel not creating a new label #2400

Closed ImPedro29 closed 3 weeks ago

ImPedro29 commented 3 weeks ago

Description

The function addNewLabels it's just not creating the new label

Environment

Steps to Reproduce

  1. Just call addNewLabel
  2. Check label on business whatsapp

Log Output

No error logs

Your Code

Available on: https://github.com/billbarsch/myzap/blob/myzap2.0/functions/WPPConnect/business.js

    static async addNewLabel(req, res) {

        try {
            let data = await Sessions.getClient(req.body.session)
            let response = await data.client.addNewLabel(req.body.name)

            res.status(200).json({
                "result": 200,
                "token": response
            })

        } catch (error) {

            logger.error(`Error on getClientTokenBrowser: ${error?.message}`)

            res.status(400).json({
                response: false,
                data: error?.message
            });
        }

    }
icleitoncosta commented 3 weeks ago

Update your whatsappVersion and test again