From fc252568b84e8d72d970770d076837968f8ebe65 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sat, 30 Jul 2022 13:19:54 +0300 Subject: [PATCH] Save discord invite code instead of the whole URL --- app/db/seed.ts | 6 +++--- app/db/types.ts | 2 ++ app/routes/calendar/new.tsx | 4 ++-- migrations/006-calendar.js | 3 ++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/db/seed.ts b/app/db/seed.ts index d65c4c4ed..b70c3e911 100644 --- a/app/db/seed.ts +++ b/app/db/seed.ts @@ -330,7 +330,7 @@ function calendarEvents() { "id", "name", "description", - "discordUrl", + "discordInviteCode", "bracketUrl", "authorId", "tags" @@ -338,7 +338,7 @@ function calendarEvents() { $id, $name, $description, - $discordUrl, + $discordInviteCode, $bracketUrl, $authorId, $tags @@ -351,7 +351,7 @@ function calendarEvents() { faker.word.noun() )}`, description: faker.lorem.paragraph(), - discordUrl: faker.internet.url(), + discordInviteCode: faker.lorem.word(), bracketUrl: faker.internet.url(), authorId: userIds.pop(), tags: diff --git a/app/db/types.ts b/app/db/types.ts index 67f8b96da..44ba83d3f 100644 --- a/app/db/types.ts +++ b/app/db/types.ts @@ -85,6 +85,8 @@ export interface CalendarEvent { authorId: number; tags?: string; description: string | null; + discordInviteCode: string | null; + // generated column discordUrl: string | null; bracketUrl: string; participantCount: number | null; diff --git a/app/routes/calendar/new.tsx b/app/routes/calendar/new.tsx index db1e47a64..ec6257b9c 100644 --- a/app/routes/calendar/new.tsx +++ b/app/routes/calendar/new.tsx @@ -180,8 +180,8 @@ function DatesInput() { function DiscordLinkInput() { return (