Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Post" ADD COLUMN "article_level" TEXT;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
Warnings:

- Made the column `article_level` on table `Post` required. This step will fail if there are existing NULL values in that column.

*/
-- AlterTable
ALTER TABLE "Post" ALTER COLUMN "article_level" SET NOT NULL;
1 change: 1 addition & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ model Post {
slug String @unique
previewImageLink String?
estimated_time Int @default(0)
article_level String
authorId Int
categoryId Int
createdAt DateTime @default(now())
Expand Down
3 changes: 3 additions & 0 deletions src/modules/posts/dto/create-post.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ export class CreatePostDto {
@IsString()
slug: string;

@IsString()
article_level: string;

@IsInt()
authorId: number;

Expand Down
1 change: 1 addition & 0 deletions src/modules/posts/posts.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class PostsService {
coverImageLink: data.coverImageLink,
previewImageLink: data.previewImageLink,
estimated_time,
article_level: data.article_level,
author: { connect: { id: data.authorId } },
category: { connect: { id: data.categoryId } },
},
Expand Down
50 changes: 49 additions & 1 deletion src/seed/post.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ Por isso, eu hoje não levo esse pensamento comigo. Posso até demorar um pouco
slug: 'faz-funcionar-e-depois-melhora-sera-mesmo',
isPublished: true,
categoryId: 1,
article_level: '',
estimated_time: 3,
},
});

Expand Down Expand Up @@ -91,6 +93,8 @@ No próximo post vou contar como eu (Leticia) e o Mikael nos tornamos competidor
slug: 'olimpiada-do-conhecimento',
isPublished: true,
categoryId: 2,
article_level: '',
estimated_time: 3,
},
});

Expand Down Expand Up @@ -134,6 +138,8 @@ Esse é apenas um dos muitos posts que vamos documentar nossa experiência duran
slug: 'techknowledge-ponto-zero',
isPublished: true,
categoryId: 3,
article_level: '',
estimated_time: 4,
},
});

Expand Down Expand Up @@ -163,6 +169,8 @@ Para mais informações, aqui está meu Linkedin: https://www.linkedin.com/in/mi
slug: 'quem-somos-nos',
isPublished: true,
categoryId: 3,
article_level: '',
estimated_time: 1,
},
});

Expand Down Expand Up @@ -224,6 +232,8 @@ O segredo está em nunca parar de aprender, manter a curiosidade viva e, princip
slug: 'desafios-desenvolvedor-frontend',
isPublished: true,
categoryId: 1,
article_level: '',
estimated_time: 4,
},
});

Expand All @@ -239,6 +249,8 @@ O segredo está em nunca parar de aprender, manter a curiosidade viva e, princip
slug: 'errando-que-se-aprende',
isPublished: true,
categoryId: 1,
article_level: '',
estimated_time: 6,
},
});

Expand Down Expand Up @@ -286,6 +298,8 @@ Escolha um projeto. Qualquer um. Algo que te motive. Algo que te faça pesquisar
slug: 'pratique-como-ser-um-desenvolvedor',
isPublished: true,
categoryId: 1,
article_level: '',
estimated_time: 4,
},
});

Expand Down Expand Up @@ -384,6 +398,8 @@ Se você também está nesse caminho, saiba que cada passo importa. E o próximo
slug: 'criando-minhas-interfaces',
isPublished: true,
categoryId: 1,
article_level: '',
estimated_time: 7,
},
});

Expand Down Expand Up @@ -508,6 +524,8 @@ O segredo? **Nunca parar de aprender e sempre buscar entregar valor com o que vo
slug: 'desenvolvimento-mobile-2025',
isPublished: true,
categoryId: 7,
article_level: '',
estimated_time: 4,
},
});

Expand Down Expand Up @@ -594,6 +612,8 @@ Para mim, tem sido uma experiência fantástica tanto profissional quanto pessoa
slug: 'morar-fora-do-brasil-vale-a-pena-mesmo',
isPublished: true,
categoryId: 1,
article_level: '',
estimated_time: 7,
},
},
);
Expand Down Expand Up @@ -682,6 +702,8 @@ Trabalhar como freelancer tem sido uma jornada cheia de aprendizados, desafios e
slug: 'primeiros-passos-como-freelance',
isPublished: true,
categoryId: 8,
article_level: '',
estimated_time: 6,
},
});

Expand All @@ -697,6 +719,8 @@ Trabalhar como freelancer tem sido uma jornada cheia de aprendizados, desafios e
slug: 'componentes',
isPublished: true,
categoryId: 9,
article_level: '',
estimated_time: 8,
},
});

Expand All @@ -712,6 +736,8 @@ Trabalhar como freelancer tem sido uma jornada cheia de aprendizados, desafios e
slug: 'tailwind-mobile-first',
isPublished: true,
categoryId: 10,
article_level: '',
estimated_time: 4,
},
});

Expand All @@ -727,11 +753,13 @@ Trabalhar como freelancer tem sido uma jornada cheia de aprendizados, desafios e
slug: 'tailwind-uma-ferramenta-poderosa',
isPublished: true,
categoryId: 10,
article_level: '',
estimated_time: 5,
},
});

const GENERIC_COMPONENTS = await prisma.post.upsert({
where: { id: 18 },
where: { id: 17 },
update: {},
create: {
title: 'Componentes Genéricos: A Arte de Não Reinventar a Roda (Parte 1)',
Expand All @@ -742,6 +770,25 @@ Trabalhar como freelancer tem sido uma jornada cheia de aprendizados, desafios e
slug: 'componentes-genericos-arte-de-nao-reinventar-roda-parte-1',
isPublished: true,
categoryId: 9,
article_level: '',
estimated_time: 8,
},
});

const GENERIC_COMPONENTS_02 = await prisma.post.upsert({
where: { id: 18 },
update: {},
create: {
title: 'Componentes Genéricos: A Arte de Não Reinventar a Roda (Parte 2)',
authorId: 4,
content: ``,
previewContent:
'Na Parte 2, vamos explorar quando faz sentido usar componentes genéricos e quando isso pode virar um problema. Inclui o caso real dos filtros genéricos que deu tudo errado e lições práticas para evitar armadilhas.',
slug: 'componentes-genericos-arte-de-nao-reinventar-roda-parte-2',
isPublished: true,
categoryId: 9,
article_level: '',
estimated_time: 8,
},
});

Expand All @@ -761,5 +808,6 @@ Trabalhar como freelancer tem sido uma jornada cheia de aprendizados, desafios e
TAILWINDCSS_IS_MOBILE_FIRST,
TAILWINDCSS_A_POWERFUL_TOOL,
GENERIC_COMPONENTS,
GENERIC_COMPONENTS_02,
});
}
Loading