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 "views" INTEGER DEFAULT 0;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
Warnings:

- You are about to drop the column `views` on the `Post` table. All the data in the column will be lost.

*/
-- AlterTable
ALTER TABLE "Post" DROP COLUMN "views";
5 changes: 5 additions & 0 deletions src/modules/posts/posts.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ export class PostsService {
},
},
},
orderBy: {
category: {
name: 'asc',
},
},
});

if (!posts) {
Expand Down
16 changes: 16 additions & 0 deletions src/seed/post.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,21 @@ Trabalhar como freelancer tem sido uma jornada cheia de aprendizados, desafios e
},
});

const GENERIC_COMPONENTS = await prisma.post.upsert({
where: { id: 18 },
update: {},
create: {
title: 'Componentes Genéricos: A Arte de Não Reinventar a Roda (Parte 1)',
authorId: 4,
content: ``,
previewContent:
'Descubra como os componentes genéricos podem transformar sua forma de programar, evitando código duplicado e trazendo mais clareza e reutilização ao seu projeto.',
slug: 'componentes-genericos-arte-de-nao-reinventar-roda-parte-1',
isPublished: true,
categoryId: 9,
},
});

console.log({
FAZ_FUNCIONAR_E_DEPOIS_MELHORA_SERA_MESMO,
OLIMPIADA_DO_CONHECIMENTO,
Expand All @@ -745,5 +760,6 @@ Trabalhar como freelancer tem sido uma jornada cheia de aprendizados, desafios e
COMPONENTS,
TAILWINDCSS_IS_MOBILE_FIRST,
TAILWINDCSS_A_POWERFUL_TOOL,
GENERIC_COMPONENTS,
});
}
Loading