diff --git a/packages/api/src/router/user.ts b/packages/api/src/router/user.ts index 8a71422..bb13d98 100644 --- a/packages/api/src/router/user.ts +++ b/packages/api/src/router/user.ts @@ -55,7 +55,10 @@ export const userRouter = createTRPCRouter({ setDefaultAddress: protectedProcedure .input(addressIdSchema) .mutation(async ({ input, ctx }) => { - await ctx.db.update(addresses).set({ default: false }); + await ctx.db + .update(addresses) + .set({ default: false }) + .where(eq(addresses.userId, ctx.auth.userId)); return await ctx.db .update(addresses)