From 9695bba2e993b48ae333da622fa459dbaacb9349 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sat, 31 May 2025 18:46:04 +0100 Subject: feat: Generate RSS feeds from lists (#1507) * refactor: Move bookmark utils from shared-react to shared * Expose RSS feeds for lists * Add e2e tests * Slightly improve the look of the share dialog * allow specifying a limit in the rss endpoint --- apps/workers/trpc.ts | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) (limited to 'apps/workers') diff --git a/apps/workers/trpc.ts b/apps/workers/trpc.ts index c5f880ad..28cd2d0b 100644 --- a/apps/workers/trpc.ts +++ b/apps/workers/trpc.ts @@ -1,36 +1,8 @@ -import { eq } from "drizzle-orm"; - -import { db } from "@karakeep/db"; -import { users } from "@karakeep/db/schema"; -import { AuthedContext, createCallerFactory } from "@karakeep/trpc"; +import { createCallerFactory } from "@karakeep/trpc"; +import { buildImpersonatingAuthedContext as buildAuthedContext } from "@karakeep/trpc/lib/impersonate"; import { appRouter } from "@karakeep/trpc/routers/_app"; -/** - * This is only safe to use in the context of a worker. - */ -export async function buildImpersonatingAuthedContext( - userId: string, -): Promise { - const user = await db.query.users.findFirst({ - where: eq(users.id, userId), - }); - if (!user) { - throw new Error("User not found"); - } - - return { - user: { - id: user.id, - name: user.name, - email: user.email, - role: user.role, - }, - db, - req: { - ip: null, - }, - }; -} +export const buildImpersonatingAuthedContext = buildAuthedContext; /** * This is only safe to use in the context of a worker. -- cgit v1.2.3-70-g09d2