Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
SidRao1331 opened this issue Jul 25, 2024 · 4 comments
Open

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

SidRao1331 opened this issue Jul 25, 2024 · 4 comments
Assignees

Comments

@SidRao1331
Copy link

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
Copy link
Contributor

atovpeko commented Nov 1, 2024

@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
Copy link

@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
Copy link
Contributor

atovpeko commented Nov 4, 2024

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

@SidRao1331
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants