Skip to content

Commit b4abdfe

Browse files
Revert "Merge pull request #30 from nurul3101/update-prisma"
This reverts commit 397b707, reversing changes made to 4645f53.
1 parent 397b707 commit b4abdfe

File tree

8 files changed

+576
-2426
lines changed

8 files changed

+576
-2426
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
node_modules/
22
.next/
3-
.env
4-
/prisma/generated
3+
.env

components/Header.tsx

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ const Header: React.FC = () => {
1212

1313
let left = (
1414
<div className="left">
15-
<Link href="/" className="bold" data-active={isActive("/")}>
16-
Feed
15+
<Link href="/">
16+
<a className="bold" data-active={isActive("/")}>
17+
Feed
18+
</a>
1719
</Link>
1820
<style jsx>{`
1921
.bold {
@@ -42,8 +44,10 @@ const Header: React.FC = () => {
4244
if (status === 'loading') {
4345
left = (
4446
<div className="left">
45-
<Link href="/" className="bold" data-active={isActive("/")}>
46-
Feed
47+
<Link href="/">
48+
<a className="bold" data-active={isActive("/")}>
49+
Feed
50+
</a>
4751
</Link>
4852
<style jsx>{`
4953
.bold {
@@ -81,8 +85,8 @@ const Header: React.FC = () => {
8185
if (!session) {
8286
right = (
8387
<div className="right">
84-
<Link href="/api/auth/signin" data-active={isActive("/signup")}>
85-
Log in
88+
<Link href="/api/auth/signin">
89+
<a data-active={isActive("/signup")}>Log in</a>
8690
</Link>
8791
<style jsx>{`
8892
a {
@@ -112,11 +116,13 @@ const Header: React.FC = () => {
112116
if (session) {
113117
left = (
114118
<div className="left">
115-
<Link href="/" className="bold" data-active={isActive("/")}>
116-
Feed
119+
<Link href="/">
120+
<a className="bold" data-active={isActive("/")}>
121+
Feed
122+
</a>
117123
</Link>
118-
<Link href="/drafts" data-active={isActive("/drafts")}>
119-
My drafts
124+
<Link href="/drafts">
125+
<a data-active={isActive("/drafts")}>My drafts</a>
120126
</Link>
121127
<style jsx>{`
122128
.bold {
@@ -145,10 +151,12 @@ const Header: React.FC = () => {
145151
{session.user.name} ({session.user.email})
146152
</p>
147153
<Link href="/create">
148-
<button>New post</button>
154+
<button>
155+
<a>New post</a>
156+
</button>
149157
</Link>
150158
<button onClick={() => signOut()}>
151-
Log out
159+
<a>Log out</a>
152160
</button>
153161
<style jsx>{`
154162
a {

lib/prisma.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { PrismaClient } from "../prisma/generated/client";
2-
import { PrismaPg } from "@prisma/adapter-pg";
1+
import { PrismaClient } from "@prisma/client";
32

43
// PrismaClient is attached to the `global` object in development to prevent
54
// exhausting your database connection limit.
@@ -9,18 +8,11 @@ import { PrismaPg } from "@prisma/adapter-pg";
98

109
let prisma: PrismaClient
1110

12-
const adapter = new PrismaPg({
13-
connectionString: process.env.DATABASE_URL,
14-
})
1511
if (process.env.NODE_ENV === 'production') {
16-
prisma = new PrismaClient({
17-
adapter,
18-
})
12+
prisma = new PrismaClient()
1913
} else {
2014
if (!global.prisma) {
21-
global.prisma = new PrismaClient({
22-
adapter,
23-
})
15+
global.prisma = new PrismaClient()
2416
}
2517
prisma = global.prisma
2618
}

0 commit comments

Comments
 (0)