AgoraIO / Docs-Source

A repository for the Agora Docs source content.
MIT License
20 stars 11 forks source link

[Bug]: incomplete syntax in create chat group line #1580

Closed SidRao1331 closed 1 week ago

SidRao1331 commented 4 months ago

Platform

Web

Platform details

No response

Product

Chat

Product details

No response

Business Case

Cuts down time in exploring what is causing the issue

Subject Matter Expert

No response

Documentation Link

https://docs.agora.io/en/agora-chat/client-api/chat-group/manage-chat-groups?platform=web#create-and-destroy-a-chat-group

Scope

the create chat group document must be updated

conn.createGroup(option).then((res) => console.log(res));

there is a check in the agora-chat.js that is as follows

      function d(e3) {
        if (!e3 || !e3.data)
          throw Error("Invalid parameter");

when option is sent it populates e3 but not e3.data despite the parameters being correct, hence the parameters need to be sent as conn.createGroup({ data: options });

Acceptance Criteria

conn.createGroup(option).then((res) => console.log(res));

there is a check in the agora-chat.js that is as follows function d(e3) { if (!e3 || !e3.data) throw Error("Invalid parameter");

when option is sent it populates e3 but not e3.data despite the parameters being correct, hence the parameters need to be sent as conn.createGroup({ data: options });

Additional Information

No response

atovpeko commented 3 weeks ago

@SidRao1331 should the sample code be updated like this then?

conn.createGroup(option).then((res) => console.log(res));
      function d(e3) {
        if (!e3 || !e3.data)
          throw Error("Invalid parameter");
SidRao333 commented 3 weeks ago

@atovpeko no I think removing e3.data from the if condition should work. In the documentation they dont send the option via data, there is nothing under e3 called data so e3.data not existing is causing the issue.

atovpeko commented 3 weeks ago

@SidRao1331 Thanks! So like this ? Screenshot (2)

SidRao1331 commented 3 weeks ago

@atovpeko Yes this would make it work. It would be inconsistent with other sdk commands but it would work.