Skip to content

Commit d65d7b8

Browse files
authored
Merge pull request #64 from techknowledge-blog/feature/article-levels
Article Level
2 parents 73c08f7 + 52f7021 commit d65d7b8

File tree

6 files changed

+64
-1
lines changed

6 files changed

+64
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- AlterTable
2+
ALTER TABLE "Post" ADD COLUMN "article_level" TEXT;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
Warnings:
3+
4+
- Made the column `article_level` on table `Post` required. This step will fail if there are existing NULL values in that column.
5+
6+
*/
7+
-- AlterTable
8+
ALTER TABLE "Post" ALTER COLUMN "article_level" SET NOT NULL;

prisma/schema.prisma

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ model Post {
4444
slug String @unique
4545
previewImageLink String?
4646
estimated_time Int @default(0)
47+
article_level String
4748
authorId Int
4849
categoryId Int
4950
createdAt DateTime @default(now())

src/modules/posts/dto/create-post.dto.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ export class CreatePostDto {
2525
@IsString()
2626
slug: string;
2727

28+
@IsString()
29+
article_level: string;
30+
2831
@IsInt()
2932
authorId: number;
3033

src/modules/posts/posts.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export class PostsService {
3232
coverImageLink: data.coverImageLink,
3333
previewImageLink: data.previewImageLink,
3434
estimated_time,
35+
article_level: data.article_level,
3536
author: { connect: { id: data.authorId } },
3637
category: { connect: { id: data.categoryId } },
3738
},

src/seed/post.seed.ts

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ Por isso, eu hoje não levo esse pensamento comigo. Posso até demorar um pouco
5252
slug: 'faz-funcionar-e-depois-melhora-sera-mesmo',
5353
isPublished: true,
5454
categoryId: 1,
55+
article_level: '',
56+
estimated_time: 3,
5557
},
5658
});
5759

@@ -91,6 +93,8 @@ No próximo post vou contar como eu (Leticia) e o Mikael nos tornamos competidor
9193
slug: 'olimpiada-do-conhecimento',
9294
isPublished: true,
9395
categoryId: 2,
96+
article_level: '',
97+
estimated_time: 3,
9498
},
9599
});
96100

@@ -134,6 +138,8 @@ Esse é apenas um dos muitos posts que vamos documentar nossa experiência duran
134138
slug: 'techknowledge-ponto-zero',
135139
isPublished: true,
136140
categoryId: 3,
141+
article_level: '',
142+
estimated_time: 4,
137143
},
138144
});
139145

@@ -163,6 +169,8 @@ Para mais informações, aqui está meu Linkedin: https://www.linkedin.com/in/mi
163169
slug: 'quem-somos-nos',
164170
isPublished: true,
165171
categoryId: 3,
172+
article_level: '',
173+
estimated_time: 1,
166174
},
167175
});
168176

@@ -224,6 +232,8 @@ O segredo está em nunca parar de aprender, manter a curiosidade viva e, princip
224232
slug: 'desafios-desenvolvedor-frontend',
225233
isPublished: true,
226234
categoryId: 1,
235+
article_level: '',
236+
estimated_time: 4,
227237
},
228238
});
229239

@@ -239,6 +249,8 @@ O segredo está em nunca parar de aprender, manter a curiosidade viva e, princip
239249
slug: 'errando-que-se-aprende',
240250
isPublished: true,
241251
categoryId: 1,
252+
article_level: '',
253+
estimated_time: 6,
242254
},
243255
});
244256

@@ -286,6 +298,8 @@ Escolha um projeto. Qualquer um. Algo que te motive. Algo que te faça pesquisar
286298
slug: 'pratique-como-ser-um-desenvolvedor',
287299
isPublished: true,
288300
categoryId: 1,
301+
article_level: '',
302+
estimated_time: 4,
289303
},
290304
});
291305

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

@@ -508,6 +524,8 @@ O segredo? **Nunca parar de aprender e sempre buscar entregar valor com o que vo
508524
slug: 'desenvolvimento-mobile-2025',
509525
isPublished: true,
510526
categoryId: 7,
527+
article_level: '',
528+
estimated_time: 4,
511529
},
512530
});
513531

@@ -594,6 +612,8 @@ Para mim, tem sido uma experiência fantástica tanto profissional quanto pessoa
594612
slug: 'morar-fora-do-brasil-vale-a-pena-mesmo',
595613
isPublished: true,
596614
categoryId: 1,
615+
article_level: '',
616+
estimated_time: 7,
597617
},
598618
},
599619
);
@@ -682,6 +702,8 @@ Trabalhar como freelancer tem sido uma jornada cheia de aprendizados, desafios e
682702
slug: 'primeiros-passos-como-freelance',
683703
isPublished: true,
684704
categoryId: 8,
705+
article_level: '',
706+
estimated_time: 6,
685707
},
686708
});
687709

@@ -697,6 +719,8 @@ Trabalhar como freelancer tem sido uma jornada cheia de aprendizados, desafios e
697719
slug: 'componentes',
698720
isPublished: true,
699721
categoryId: 9,
722+
article_level: '',
723+
estimated_time: 8,
700724
},
701725
});
702726

@@ -712,6 +736,8 @@ Trabalhar como freelancer tem sido uma jornada cheia de aprendizados, desafios e
712736
slug: 'tailwind-mobile-first',
713737
isPublished: true,
714738
categoryId: 10,
739+
article_level: '',
740+
estimated_time: 4,
715741
},
716742
});
717743

@@ -727,11 +753,13 @@ Trabalhar como freelancer tem sido uma jornada cheia de aprendizados, desafios e
727753
slug: 'tailwind-uma-ferramenta-poderosa',
728754
isPublished: true,
729755
categoryId: 10,
756+
article_level: '',
757+
estimated_time: 5,
730758
},
731759
});
732760

733761
const GENERIC_COMPONENTS = await prisma.post.upsert({
734-
where: { id: 18 },
762+
where: { id: 17 },
735763
update: {},
736764
create: {
737765
title: 'Componentes Genéricos: A Arte de Não Reinventar a Roda (Parte 1)',
@@ -742,6 +770,25 @@ Trabalhar como freelancer tem sido uma jornada cheia de aprendizados, desafios e
742770
slug: 'componentes-genericos-arte-de-nao-reinventar-roda-parte-1',
743771
isPublished: true,
744772
categoryId: 9,
773+
article_level: '',
774+
estimated_time: 8,
775+
},
776+
});
777+
778+
const GENERIC_COMPONENTS_02 = await prisma.post.upsert({
779+
where: { id: 18 },
780+
update: {},
781+
create: {
782+
title: 'Componentes Genéricos: A Arte de Não Reinventar a Roda (Parte 2)',
783+
authorId: 4,
784+
content: ``,
785+
previewContent:
786+
'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.',
787+
slug: 'componentes-genericos-arte-de-nao-reinventar-roda-parte-2',
788+
isPublished: true,
789+
categoryId: 9,
790+
article_level: '',
791+
estimated_time: 8,
745792
},
746793
});
747794

@@ -761,5 +808,6 @@ Trabalhar como freelancer tem sido uma jornada cheia de aprendizados, desafios e
761808
TAILWINDCSS_IS_MOBILE_FIRST,
762809
TAILWINDCSS_A_POWERFUL_TOOL,
763810
GENERIC_COMPONENTS,
811+
GENERIC_COMPONENTS_02,
764812
});
765813
}

0 commit comments

Comments
 (0)