nizarfadlan / baileys-api

Simple WhatsApp REST API with multiple device support
MIT License
92 stars 45 forks source link

Groups that not being return #19

Open unrealmaow opened 1 week ago

unrealmaow commented 1 week ago

Unable to receive Groups List Data.

It always shows null in response.

unrealmaow commented 1 week ago

[Update]

Here is the updated code in Groups.js File

const groups = yield database_1.prisma.contact.findMany({ cursor: cursor ? { pkId: Number(cursor) } : undefined, take: Number(limit), skip: cursor ? 1 : 0, where: { id: { endsWith: "g.us" }, // Only groups, since group IDs in WhatsApp end with "g.us" sessionId, AND: search ? { name: { contains: String(search), }, } : {}, // Only add this condition if 'search' is provided }, });

    It works fine