The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
add `logo` to openapi
Steven Teyd547743bc7f4
diff --git a/apps/web/app/api/qr/route.tsx b/apps/web/app/api/qr/route.tsxindex 5202160ae8..68e9ec4253 100644--- a/apps/web/app/api/qr/route.tsx+++ b/apps/web/app/api/qr/route.tsx@@ -13,12 +13,9 @@ export async function GET(req: NextRequest) {await ratelimitOrThrow(req, "qr");const params = getSearchParams(req.url);- const { url, size, level, fgColor, bgColor, includeMargin } =+ const { url, logo, size, level, fgColor, bgColor, includeMargin } =getQRCodeQuerySchema.parse(params);- const logo =- req.nextUrl.searchParams.get("logo") || "https://assets.dub.co/logo.png";-return new ImageResponse(QRCodeSVG({value: url,diff --git a/apps/web/lib/zod/schemas/qr.ts b/apps/web/lib/zod/schemas/qr.tsindex 0209a21924..8462af07d8 100644--- a/apps/web/lib/zod/schemas/qr.ts+++ b/apps/web/lib/zod/schemas/qr.ts@@ -10,6 +10,13 @@ import { parseUrlSchema } from "./utils";export const getQRCodeQuerySchema = z.object({url: parseUrlSchema.describe("The URL to generate a QR code for."),+ logo: z+ .string()+ .optional()+ .default("https://assets.dub.co/logo.png")+ .describe(+ "The logo to include in the QR code. Defaults to `https://assets.dub.co/logo.png` if not provided.",+ ),size: z.coerce.number().optional()