Skip to content

Commit fa92a19

Browse files
committed
fix: apply feedback
1 parent d452c7c commit fa92a19

File tree

5 files changed

+25
-33
lines changed

5 files changed

+25
-33
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
DATABASE_URL="postgresql://USERNAME:PASSWORD@localhost:6500/DATABASENAME?schema=public"
1+
DATABASE_URL=

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,4 @@ node_modules
77

88
# Local Netlify folder
99
.netlify
10-
.DS_Store
11-
/prisma/docs
12-
prisma/credentials
10+
.DS_Store

app/routes/event.$slug.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ import { prisma } from "~/utils/db.server";
55

66
export const loader = async ({ params }: LoaderFunctionArgs) => {
77
if (!params.slug) {
8-
throw new Error("Missing eventid param");
8+
throw new Error("Missing event slug");
99
}
10-
const event = await prisma.events.findFirst({
10+
const event = await prisma.event.findFirst({
1111
where: {
1212
slug: params.slug,
1313
},
1414
});
1515
if (!event) {
16-
throw new Response("Not Found", { status: 404 });
16+
throw new Response(null, {
17+
status: 404,
18+
statusText: "Event Not Found",
19+
});
1720
}
1821
return json({ event });
1922
};
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
1-
/*
2-
Warnings:
3-
4-
- You are about to drop the `Event` table. If the table is not empty, all the data it contains will be lost.
5-
6-
*/
7-
-- DropTable
8-
DROP TABLE "Event";
9-
101
-- CreateTable
11-
CREATE TABLE "Events" (
2+
CREATE TABLE "Event" (
123
"id" TEXT NOT NULL,
134
"slug" TEXT NOT NULL,
145
"title" TEXT NOT NULL,
@@ -19,13 +10,13 @@ CREATE TABLE "Events" (
1910
"description" TEXT NOT NULL,
2011
"locationName" TEXT NOT NULL,
2112
"locationAddress" TEXT NOT NULL,
22-
"eventAgendas" TEXT[],
23-
"registration" TEXT NOT NULL,
13+
"agendas" TEXT[],
14+
"registrationInfo" TEXT NOT NULL,
2415
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
2516
"updatedAt" TIMESTAMP(3) NOT NULL,
2617

27-
CONSTRAINT "Events_pkey" PRIMARY KEY ("id")
18+
CONSTRAINT "Event_pkey" PRIMARY KEY ("id")
2819
);
2920

3021
-- CreateIndex
31-
CREATE UNIQUE INDEX "Events_slug_key" ON "Events"("slug");
22+
CREATE UNIQUE INDEX "Event_slug_key" ON "Event"("slug");

prisma/schema.prisma

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ datasource db {
1111
url = env("DATABASE_URL")
1212
}
1313

14-
model Events {
14+
model Event {
1515
id String @id @default(cuid())
1616
17-
slug String @unique
18-
title String @db.Text
19-
imageUrl String
20-
dateTimeStart DateTime @default(now())
21-
dateTimeEnd DateTime @default(now())
22-
url String // Url for online or hybrid
23-
description String @db.Text
24-
locationName String
25-
locationAddress String
26-
eventAgendas String[]
27-
registration String @db.Text
17+
slug String @unique
18+
title String @db.Text
19+
imageUrl String
20+
dateTimeStart DateTime @default(now())
21+
dateTimeEnd DateTime @default(now())
22+
url String // Url for online or hybrid
23+
description String @db.Text
24+
locationName String
25+
locationAddress String
26+
agendas String[]
27+
registrationInfo String @db.Text
2828
2929
createdAt DateTime @default(now())
3030
updatedAt DateTime @updatedAt

0 commit comments

Comments
 (0)