Skip to content
This repository was archived by the owner on Jul 23, 2021. It is now read-only.
This repository was 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

@dannyYassine

Description

@dannyYassine

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions