Skip to content
This repository has been archived by the owner on Jul 23, 2021. It is now read-only.

Exposed update function for only updating a conversation; participants in params is not needed, when updating a conversation. #8

Open
dannyYassine opened this issue Apr 22, 2021 · 4 comments

Comments

@dannyYassine
Copy link

dannyYassine commented Apr 22, 2021

Hi there, I am a full stack developer at ClearEstate, trying to integrate your lib to our app!

inside Shapin\TalkJS\Api\Conversation, when updating a conversation, you are expecting an array of participants, where using directly the Talkjs REST API, this is not required, since the conversation already exists.

It would be great to have another function to explicitly updating a conversation:

/**
     * @throws Exception
     */
    public function update(string $id, array $params)
    {
          if (empty($params)) {
              throw new Exception\InvalidArgumentException('Params must be non-empty');
          }

        $response = $this->httpPut("conversations/$id", $params);

        if (200 !== $response->getStatusCode()) {
            $this->handleErrors($response);
        }

        return $this->hydrator->hydrate($response, Model\Conversation\ConversationCreatedOrUpdated::class);
    }

Thank you so much for your time, really appreciate it.

@odolbeau
Copy link
Member

Hi @dannyYassine!

Good idea, don't hesitate to open a PR, I'll be glad to consider it. :)

@dannyYassine
Copy link
Author

Will do!

I'll have one ready in the next few hours.

@dannyYassine
Copy link
Author

Hi @odolbeau,

I have a my code ready and tested, but looks like you need to grant me permission? I cant push my changes / create a branch to the repo.

Screen Shot 2021-04-23 at 10 16 05 AM

thanks

@odolbeau
Copy link
Member

You have to fork this repository.
You can find more information in documentation.

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

No branches or pull requests

2 participants