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

getTemplate and listTemplates functions fixed #30

Merged

Conversation

victorshp
Copy link
Contributor

Jira Link => https://zenvia.atlassian.net/browse/CON-318?atlOrigin=eyJpIjoiNDhmNWNlMGI4OWRiNDViNzg5NGM1NGYyODQ5ZTRiZTEiLCJwIjoiaiJ9

Problem

getTemplate() and listTemplate() functions were non-functional.
This hindered this SDK's user to list all their templates or a single template associated with a specific token registered on their Zenvia account.

Diagnostics

The .forEach() functions in line 162 and 180 (before pull request) were iterating over a supposed array identified by the key channels inside the response from GET requests on templates/ and templates/:templateId.
It is possible that at some point in time the channels key and its respective values were contained in the response for this request. If so, no longer.

Implementation

To correct the problem, the request for getTemplate() and listTemplate() will now come as they should: unedited after they are received from the Zenvia API, but typed correctly.
The tests were also fixed accordingly.

@rafael-org
Copy link
Contributor

Faltou também atualizar a versão no package.json

src/types/zenvia.ts Outdated Show resolved Hide resolved
src/types/zenvia.ts Outdated Show resolved Hide resolved
@victorshp victorshp merged commit d288048 into master Sep 1, 2021
@victorshp victorshp deleted the con-318-corrigir-implementacao-de-get-e-list-templates branch September 1, 2021 02:23
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

Successfully merging this pull request may close these issues.

None yet

2 participants