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

feat: If contact stored with name, name added in return #390

Merged
merged 5 commits into from
Feb 1, 2024

Conversation

leandrosroc
Copy link
Contributor

In chat/whatsappNumbers and chat/fetchProfile routes, name will be filled if stored
197d1a29-bb1a-4e80-b216-8488d7fb7fad
67aafc36-113a-426a-923f-e5f694005686

Copy link
Contributor

@judsonjuniorr judsonjuniorr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has been added a new property to the users array contact that only store the jid, why not only use the user.jid instead of creating a new one with the same value?

You could also make the repository.contact.find outside the map and find all contacts first in one single query, after that on the map loop you just do a .find in the result

@leandrosroc
Copy link
Contributor Author

the jid in users starts with "+"

@judsonjuniorr
Copy link
Contributor

judsonjuniorr commented Jan 31, 2024

the jid in users starts with "+"

You can remove it for example: "+55 11 9 9999-9999".replace(/\D/g, '') with this you'll get only the number values from the string, in the code would be: user.jid.replace(/\D/g, '')

@leandrosroc
Copy link
Contributor Author

using "replace", it also removes @s.whatsapp.net

@DavidsonGomes DavidsonGomes merged commit b095465 into EvolutionAPI:develop Feb 1, 2024
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.

3 participants