From a285e6f252a4e9f501a511fa76f9f1ccec1c7aae Mon Sep 17 00:00:00 2001 From: esdrasrenan Date: Mon, 15 Dec 2025 18:59:22 -0300 Subject: [PATCH] fix: corrige indices na mutation updateAvatar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Usa by_tenant_requester e by_tenant_assignee com tenantId 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- convex/users.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/convex/users.ts b/convex/users.ts index a183556..852baa5 100644 --- a/convex/users.ts +++ b/convex/users.ts @@ -327,7 +327,7 @@ export const updateAvatar = mutation({ // Atualiza snapshots de requester em tickets const requesterTickets = await ctx.db .query("tickets") - .withIndex("by_requester", (q) => q.eq("requesterId", user._id)) + .withIndex("by_tenant_requester", (q) => q.eq("tenantId", user.tenantId).eq("requesterId", user._id)) .take(10000) if (requesterTickets.length > 0) { @@ -345,7 +345,7 @@ export const updateAvatar = mutation({ // Atualiza snapshots de assignee em tickets const assigneeTickets = await ctx.db .query("tickets") - .withIndex("by_assignee", (q) => q.eq("assigneeId", user._id)) + .withIndex("by_tenant_assignee", (q) => q.eq("tenantId", user.tenantId).eq("assigneeId", user._id)) .take(10000) if (assigneeTickets.length > 0) {