diff --git a/example.env b/example.env
new file mode 100644
index 0000000..03d90ec
--- /dev/null
+++ b/example.env
@@ -0,0 +1,16 @@
+# When adding additional environment variables, the schema in "/src/env.mjs"
+# should be updated accordingly.
+
+# Prisma
+# https://www.prisma.io/docs/reference/database-reference/connection-urls#env
+DATABASE_URL=""
+NEXTAUTH_SECRET=""
+NEXTAUTH_URL="http://localhost:3000"
+EMAIL_SERVER_USER=""
+EMAIL_SERVER_PASSWORD=""
+EMAIL_SERVER_HOST="smtp.gmail.com"
+EMAIL_SERVER_PORT=465
+EMAIL_FROM=""
+NEXT_PUBLIC_CLOUDINARY_NAME=""
+
+
diff --git a/prisma/schema.prisma b/prisma/schema.prisma
index cf6b43f..34efc72 100644
--- a/prisma/schema.prisma
+++ b/prisma/schema.prisma
@@ -8,14 +8,6 @@ datasource db {
relationMode = "prisma"
}
-enum EngagementType {
- LIKE
- DISLIKE
- SAVE
- FOLLOW
- VIEW
-}
-
model User {
id String @id @default(cuid())
name String?
@@ -39,10 +31,10 @@ model User {
model Video {
id String @id @default(cuid())
- title String @default(dbgenerated("(_utf8mb4\\'No Name\\')")) @db.Text
+ title String? @db.Text
+ thumbnailUrl String? @db.Text
description String? @db.Text
- thumbnailUrl String @default(dbgenerated("(_utf8mb4\\'https://via.placeholder.com/150\\')")) @db.Text
- videoUrl String @db.Text
+ videoUrl String? @db.Text
publish Boolean @default(true)
userId String
createdAt DateTime @default(now())
@@ -59,9 +51,9 @@ model VideoEngagement {
id String @id @default(cuid())
userId String?
videoId String
- engagementType EngagementType
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
+ engagementType EngagementType
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
video Video @relation(fields: [videoId], references: [id], onDelete: Cascade)
@@ -122,10 +114,10 @@ model Announcement {
model AnnouncementEngagement {
userId String
- announcementId String
engagementType EngagementType
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
+ announcementId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
announcement Announcement @relation(fields: [announcementId], references: [id], onDelete: Cascade)
@@ -184,3 +176,11 @@ model VerificationToken {
@@unique([identifier, token])
}
+
+enum EngagementType {
+ LIKE
+ DISLIKE
+ SAVE
+ FOLLOW
+ VIEW
+}
diff --git a/src/pages/Dashboard.tsx b/src/pages/Dashboard.tsx
index e580493..976be39 100644
--- a/src/pages/Dashboard.tsx
+++ b/src/pages/Dashboard.tsx
@@ -15,11 +15,10 @@ import {
} from "~/Components/Buttons/Buttons";
import { api } from "~/utils/api";
import { GreenEye, GreenUserCheck, GreenHeart } from "~/Components/Icons/Icons";
-import React, { type ReactElement } from "react";
+import React from "react";
const Dashboard: NextPage = () => {
const { data: sessionData } = useSession();
- // ! step 1 start
const userId = sessionData?.user.id;
const { data, isLoading, error, refetch } =
api.user.getDashboardData.useQuery(userId as string);
@@ -44,8 +43,7 @@ const Dashboard: NextPage = () => {
return <>>;
}
};
- // ! step 1 End
- // ! step 3 Start
+
const stats: StatsItem[] = [
{
name: "Total Views",
@@ -63,7 +61,6 @@ const Dashboard: NextPage = () => {
icon: (className) =>