diff --git a/apps/portal/package.json b/apps/portal/package.json index 208b1940..a8a184d8 100644 --- a/apps/portal/package.json +++ b/apps/portal/package.json @@ -38,6 +38,7 @@ "react-popper-tooltip": "^4.4.2", "react-query": "^3.39.2", "superjson": "^1.10.0", + "unique-names-generator": "^4.7.1", "zod": "^3.18.0" }, "devDependencies": { diff --git a/apps/portal/prisma/migrations/20221024123252_add_upvotes_to_schema/migration.sql b/apps/portal/prisma/migrations/20221024123252_add_upvotes_to_schema/migration.sql new file mode 100644 index 00000000..81d336ec --- /dev/null +++ b/apps/portal/prisma/migrations/20221024123252_add_upvotes_to_schema/migration.sql @@ -0,0 +1,14 @@ +/* + Warnings: + + - Added the required column `upvotes` to the `QuestionsAnswerComment` table without a default value. This is not possible if the table is not empty. + +*/ +-- AlterTable +ALTER TABLE "QuestionsAnswer" ADD COLUMN "upvotes" INTEGER NOT NULL DEFAULT 0; + +-- AlterTable +ALTER TABLE "QuestionsAnswerComment" ADD COLUMN "upvotes" INTEGER NOT NULL; + +-- AlterTable +ALTER TABLE "QuestionsQuestionComment" ADD COLUMN "upvotes" INTEGER NOT NULL DEFAULT 0; diff --git a/apps/portal/prisma/migrations/20221024123849_add_upvotes_default_value/migration.sql b/apps/portal/prisma/migrations/20221024123849_add_upvotes_default_value/migration.sql new file mode 100644 index 00000000..f4a342af --- /dev/null +++ b/apps/portal/prisma/migrations/20221024123849_add_upvotes_default_value/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "QuestionsAnswerComment" ALTER COLUMN "upvotes" SET DEFAULT 0; diff --git a/apps/portal/prisma/schema.prisma b/apps/portal/prisma/schema.prisma index 2b4aec91..42f1b974 100644 --- a/apps/portal/prisma/schema.prisma +++ b/apps/portal/prisma/schema.prisma @@ -457,6 +457,7 @@ model QuestionsQuestionComment { id String @id @default(cuid()) questionId String userId String? + upvotes Int @default(0) content String @db.Text createdAt DateTime @default(now()) updatedAt DateTime @updatedAt @@ -485,6 +486,7 @@ model QuestionsAnswer { questionId String userId String? content String @db.Text + upvotes Int @default(0) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt @@ -513,6 +515,7 @@ model QuestionsAnswerComment { answerId String userId String? content String @db.Text + upvotes Int @default(0) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt diff --git a/apps/portal/src/components/global/AppShell.tsx b/apps/portal/src/components/global/AppShell.tsx index bcb9af67..a458a433 100644 --- a/apps/portal/src/components/global/AppShell.tsx +++ b/apps/portal/src/components/global/AppShell.tsx @@ -85,8 +85,8 @@ function ProfileJewel() { {({ active }) => ( @@ -178,9 +178,9 @@ export default function AppShell({ children }: Props) { {/* Content area */}
-
+

Discussions

-
-