From 2ca29af4226fe07c46c2d2349f4ee9407711f1a3 Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Thu, 29 Feb 2024 22:49:15 +0000 Subject: [PATCH] fix: Fix API key authorization --- packages/db/schema.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/db/schema.ts b/packages/db/schema.ts index 4acd86c4..8d08282e 100644 --- a/packages/db/schema.ts +++ b/packages/db/schema.ts @@ -219,3 +219,13 @@ export const tagsOnBookmarksRelations = relations( }), }), ); + +export const apiKeyRelations = relations( + apiKeys, + ({ one }) => ({ + user: one(users, { + fields: [apiKeys.userId], + references: [users.id], + }), + }), +);