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/core create post #234

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Feat/core create post #234

wants to merge 25 commits into from

Conversation

juanzeen
Copy link
Contributor

@juanzeen juanzeen commented Oct 25, 2024

Descrição

PR para realizar a criação dos posts utilizando Ecto.multi e Ecto.transaction.

Pontos para atenção

  • Progressão nas execuções do multi;
  • Criação de tags via insert_all (upserts) funcionando corretamente, contudo é necesário passar todos os dados necessários para a criação/atualização da tag no mapa de cada tag;
  • Ainda tendo dificuldades para finalizar a criação, atualmente estou tendo problemas com o campo :user_id. Não consegui encontrar nenhum ID de usuário existente, além disso nem mesmo copiando uma struct %Usuario{} do seeder tive sucesso.

Possui novas configurações?

  • Alteração na função de criar post.

Chamadas de função usadass como teste

Post.create_post(%{usuario_id: "YlSUyZTP", titulo: "Teste", conteudo: "Testando a criação", link_imagem_capa: "umlinkqualquerdeteste", blog_tags: [%{nome: "noticia", id: "um", inserted_at: DateTime.utc_now(), updated_at: DateTime.utc_now}, %{nome: "teste", id: "dois", inserted_at: DateTime.utc_now(), updated_at: DateTime.utc_now}, %{nome: "backend", id: "tres", inserted_at: DateTime.utc_now(), updated_at: DateTime.utc_now}, %{nome: "funcionaporfavor", id: "quatro", inserted_at: DateTime.utc_now, updated_at: DateTime.utc_now}]})

@juanzeen juanzeen marked this pull request as draft October 25, 2024 21:06
@juanzeen juanzeen self-assigned this Oct 25, 2024
@juanzeen juanzeen force-pushed the feat/core-create-post branch from 2c10763 to 3ef2629 Compare December 9, 2024 21:28
@juanzeen juanzeen marked this pull request as ready for review December 10, 2024 02:11
@juanzeen juanzeen requested a review from zoedsoupe December 10, 2024 02:11
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.

2 participants