From 0ce91bf3ad9581bd581c1ec483a7cf7350ab2ccb Mon Sep 17 00:00:00 2001 From: gibeom Date: Tue, 20 Aug 2024 21:35:45 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20nanoid=20=EC=83=9D=EC=84=B1=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/db/schema/invitations.query.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/db/schema/invitations.query.ts b/src/lib/db/schema/invitations.query.ts index 5a89775..820c295 100644 --- a/src/lib/db/schema/invitations.query.ts +++ b/src/lib/db/schema/invitations.query.ts @@ -11,6 +11,13 @@ import { invitations, } from "~/lib/db/schema/invitations"; +import { customAlphabet } from "nanoid"; + +const alphabet = "0123456789abcdefghijklmnopqrstuvwxyz"; +const nanoid = customAlphabet(alphabet, 5); + +// TODO 중복 방지 로직 추가되어야 함 + type CreateInvitationParams = Omit< InvitationInsert, "id" | "userId" | "eventUrl" | "createdAt" | "updatedAt" From 7af35bf646abba2ad55c081b9f7a84d6fab76e55 Mon Sep 17 00:00:00 2001 From: gibeom Date: Thu, 22 Aug 2024 21:26:27 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20import=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/db/schema/invitations.query.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib/db/schema/invitations.query.ts b/src/lib/db/schema/invitations.query.ts index 820c295..afed615 100644 --- a/src/lib/db/schema/invitations.query.ts +++ b/src/lib/db/schema/invitations.query.ts @@ -1,7 +1,6 @@ "use server"; import { count, eq, getTableColumns } from "drizzle-orm"; -import { nanoid } from "nanoid"; import { revalidatePath } from "next/cache"; import { getAuth } from "~/lib/auth/utils"; import { db } from "~/lib/db";