From a3c58b0068da4f7b3029a8a3d65de40f5664be76 Mon Sep 17 00:00:00 2001 From: Franco Carrara Date: Fri, 13 Mar 2026 00:20:35 -0300 Subject: [PATCH] add or statement so logged users can see public resumes (#2801) Co-authored-by: Franco Carrara --- src/integrations/orpc/services/resume.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/integrations/orpc/services/resume.ts b/src/integrations/orpc/services/resume.ts index f09f3539c..c2cd6d1e0 100644 --- a/src/integrations/orpc/services/resume.ts +++ b/src/integrations/orpc/services/resume.ts @@ -1,5 +1,5 @@ import { ORPCError } from "@orpc/client"; -import { and, arrayContains, asc, desc, eq, isNotNull, sql } from "drizzle-orm"; +import { and, arrayContains, asc, desc, eq, isNotNull, or, sql } from "drizzle-orm"; import { get } from "es-toolkit/compat"; import type { Operation } from "fast-json-patch"; import { match } from "ts-pattern"; @@ -190,7 +190,9 @@ export const resumeService = { and( eq(schema.resume.slug, input.slug), eq(schema.user.username, input.username), - input.currentUserId ? eq(schema.resume.userId, input.currentUserId) : eq(schema.resume.isPublic, true), + input.currentUserId + ? or(eq(schema.resume.userId, input.currentUserId), eq(schema.resume.isPublic, true)) + : eq(schema.resume.isPublic, true), ), );