Minor bug fixes

This commit is contained in:
2023-04-25 17:49:35 -05:00
parent 9e8d302c31
commit f5ffd3aa1d
2 changed files with 65 additions and 80 deletions

View File

@@ -1,102 +1,93 @@
generator client {
provider = "prisma-client-js"
provider = "prisma-client-js"
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
relationMode = "prisma"
provider = "mysql"
url = env("DATABASE_URL")
relationMode = "prisma"
}
model Account {
id String @id @default(cuid())
userId String
type String
provider String
providerAccountId String
refresh_token String? @db.Text
access_token String? @db.Text
expires_at Int?
token_type String?
scope String?
id_token String? @db.Text
session_state String?
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
id String @id @default(cuid())
userId String
type String
provider String
providerAccountId String
refresh_token String? @db.Text
access_token String? @db.Text
expires_at Int?
token_type String?
scope String?
id_token String? @db.Text
session_state String?
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@unique([provider, providerAccountId])
@@index([userId])
@@unique([provider, providerAccountId])
@@index([userId])
}
model Session {
id String @id @default(cuid())
sessionToken String @unique
userId String
expires DateTime
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
id String @id @default(cuid())
sessionToken String @unique
userId String
expires DateTime
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@index([userId])
@@index([userId])
}
model VerificationToken {
identifier String
token String @unique
expires DateTime
identifier String
token String @unique
expires DateTime
@@unique([identifier, token])
@@unique([identifier, token])
}
model User {
id String @id @default(cuid())
username String? @unique
name String?
email String @unique
emailVerified DateTime?
image String?
bio String?
accounts Account[]
sessions Session[]
authoredProjects Project[] @relation("author")
projects Project[] @relation("members")
id String @id @default(cuid())
username String? @unique
name String?
email String @unique
emailVerified DateTime?
image String?
bio String?
accounts Account[]
sessions Session[]
authoredProjects Project[] @relation("author")
projects Project[] @relation("members")
}
model Project {
id String @id @default(cuid())
createdAt DateTime @default(now())
title String
description String
authorId String
bannerImageUrl String?
state ProjectLifecycle @default(PROPOSAL)
author User @relation("author", fields: [authorId], references: [id])
members User[] @relation("members")
previews ProjectPreview[]
id String @id @default(cuid())
createdAt DateTime @default(now())
title String
description String
authorId String
bannerImageUrl String?
state ProjectLifecycle @default(PROPOSAL)
author User @relation("author", fields: [authorId], references: [id])
members User[] @relation("members")
previews ProjectPreview[]
@@index([authorId])
@@index([authorId])
}
model ProjectPreview {
projectState ProjectLifecycle
projectId String
title String?
description String?
cardImageUrl String?
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
projectState ProjectLifecycle
projectId String
title String?
description String?
cardImageUrl String?
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
@@unique([projectId, projectState])
}
model members {
A String
B String
@@unique([A, B], map: "_members_AB_unique")
@@index([B], map: "_members_B_index")
@@map("_members")
@@unique([projectId, projectState])
}
enum ProjectLifecycle {
PROPOSAL
IN_PROGRESS
REVISION
COMPLETE
PROPOSAL
IN_PROGRESS
REVISION
COMPLETE
}

View File

@@ -1,13 +1,7 @@
import { DiscoverLayout } from "@components/layouts";
import { getServerAuthSession } from "@server/auth";
import { api } from "@utils/api";
import type {
GetServerSideProps,
GetServerSidePropsContext,
InferGetServerSidePropsType,
NextPage,
} from "next";
import { ProjectCard } from "@components/projects/DisplayProjectCard";
import type { InferGetServerSidePropsType, NextPage } from "next";
import { DisplayProjectCard } from "@components/projects/DisplayProjectCard";
import { requireAuth } from "@components/HOC/requireAuth";
const Discover: NextPage<
@@ -22,7 +16,7 @@ const Discover: NextPage<
<p>Loading ...</p>
) : (
data?.map((project) => (
<ProjectCard key={project.id} project={project} />
<DisplayProjectCard key={project.id} project={project} />
))
)}
</DiscoverLayout>