Skip to content

Commit

Permalink
Cleanup unused code and import Sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
NiallJoeMaher committed Feb 26, 2024
1 parent 2008ce2 commit 35af938
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
1 change: 1 addition & 0 deletions app/(app)/settings/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Content from "./_client";
import { getServerAuthSession } from "@/server/auth";
import { customAlphabet } from "nanoid";
import prisma from "@/server/db/client";
import * as Sentry from "@sentry/nextjs";
import { isUserSubscribedToNewsletter } from "@/server/lib/newsletter";

export const metadata = {
Expand Down
7 changes: 0 additions & 7 deletions server/api/router/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ export const profileRouter = createTRPCRouter({
edit: protectedProcedure
.input(saveSettingsSchema)
.mutation(async ({ input, ctx }) => {
const existingProfile = await ctx.db.user.findUnique({
where: {
id: ctx.session.user.id,
},
});

const { email } = ctx.session.user;

if (!email) {
Expand All @@ -37,7 +31,6 @@ export const profileRouter = createTRPCRouter({
const newsletter = await isUserSubscribedToNewsletter(email);

if (newsletter !== input.newsletter) {
const email = existingProfile?.email;
const action = input.newsletter ? "subscribe" : "unsubscribe";
if (!email) {
throw new TRPCError({
Expand Down

0 comments on commit 35af938

Please sign in to comment.