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: Buscar a quantidade de comentários por post na homepage #340

Closed

Conversation

gabrielew
Copy link
Contributor

@gabrielew gabrielew commented May 19, 2022

Ainda não cheguei a montar a parte de testes #334

Quem quiser dar pull e realizar alterações fique a vontade!

@vercel
Copy link

vercel bot commented May 19, 2022

@gabrielew is attempting to deploy a commit to the TabNews Team on Vercel.

To accomplish this, @gabrielew needs to request access to the Team.

Afterwards, an owner of the Team is required to accept their membership request.

If you're already a member of the respective Vercel Team, make sure that your Personal Vercel Account is connected to your GitHub account.

…ildren_count'

Agora é possível retornar a proriedade 'children_count' na home e também quando você seleciona um
usuário específico
async function findChildrenCount(contents) {
const contentsWithChildrenAmount = [];
for await (const content of contents) {
const children = await findChildrenAmount({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Está é a melhorar maneira de buscar a quantidade de children_count?

@@ -541,11 +570,91 @@ async function findChildren(options) {
}
}

async function findChildrenAmount(options) {
Copy link
Contributor Author

@gabrielew gabrielew May 20, 2022

Choose a reason for hiding this comment

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

Dupliquei a função findChildren, porém reduzi o máximo possível de campos retornados na query.

@gabrielew
Copy link
Contributor Author

@filipedeschamps do jeito que fiz a consulta não está retornando todo o children no endpoint.

Acha coerente com o que é pedido?

Captura de Tela 2022-05-20 às 16 59 58

@filipedeschamps
Copy link
Owner

@gabrielew show!!! Muito obrigado pela contribuição! Sobre o children não ir para o frontend, perfeito! O detalhe é que ele está saindo do Banco de Dados e indo para o Backend. Veja nesse outro PR do @EmanoelCristhian como ele fez o count(children.id) para que saia do Banco de Dados apenas um número:

count(children.id)

Ainda estou revisando o PR dele e faltam algumas coisas, mas acredito que seja interessante dar continuidade com a dele por ter uma implementação mais semântica, mas o PR não cobre a parte do frontend. Então a gente pode separar em duas implementações separadas, para aproveitar o que você fez no frontend... então por enquanto deixe esse PR aberto, combinado? 🤝

@filipedeschamps
Copy link
Owner

@gabrielew você foi citado na última publicação comemorativa: https://www.tabnews.com.br/filipedeschamps/nova-melhoria-numero-de-comentarios-nas-publicacoes 😍

@filipedeschamps filipedeschamps deleted the feat/mostrar-quantidade-de-comentarios-por-post branch June 7, 2022 05:40
@gabrielew
Copy link
Contributor Author

@gabrielew você foi citado na última publicação comemorativa: https://www.tabnews.com.br/filipedeschamps/nova-melhoria-numero-de-comentarios-nas-publicacoes 😍

@filipedeschamps massa!! Vi por lá mesmo, kkk

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