mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-30 07:12:36 -05:00
Save discord invite code instead of the whole URL
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -180,8 +180,8 @@ function DatesInput() {
|
||||
function DiscordLinkInput() {
|
||||
return (
|
||||
<div className="stack items-start">
|
||||
<Label htmlFor="discordUrl">Discord server invite URL</Label>
|
||||
<Input name="discordUrl" leftAddon="https://discord.gg/" />
|
||||
<Label htmlFor="discordInviteCode">Discord server invite URL</Label>
|
||||
<Input name="discordInviteCode" leftAddon="https://discord.gg/" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,8 @@ module.exports.up = function (db) {
|
||||
"authorId" integer not null,
|
||||
"bracketUrl" text not null,
|
||||
"description" text,
|
||||
"discordUrl" text,
|
||||
"discordInviteCode" text,
|
||||
"discordUrl" text generated always as ('https://discord.gg/' || "discordInviteCode") virtual,
|
||||
"participantCount" integer,
|
||||
"tags" text,
|
||||
foreign key ("authorId") references "User"("id") on delete restrict
|
||||
|
||||
Reference in New Issue
Block a user