refactor: update repo funcs to drizzle

This commit is contained in:
Henry
2025-04-24 14:07:41 +01:00
parent c1348cf455
commit d83e9d4dc5
20 changed files with 659 additions and 604 deletions

View File

@@ -17,7 +17,7 @@ export const authRouter = createTRPCRouter({
.input(z.object({ email: z.string() }))
.output(z.object({ success: z.boolean() }))
.mutation(async ({ ctx, input }) => {
const { data } = await ctx.db.auth.signInWithOtp({
const { data } = await ctx.supabaseClient.auth.signInWithOtp({
email: input.email,
options: {
emailRedirectTo: `${process.env.WEBSITE_URL}`,
@@ -52,7 +52,7 @@ export const authRouter = createTRPCRouter({
code: "BAD_REQUEST",
});
const { data } = await ctx.db.auth.signInWithOAuth({
const { data } = await ctx.supabaseClient.auth.signInWithOAuth({
provider: "google",
options: {
queryParams: {

View File

@@ -333,7 +333,7 @@ export const cardRouter = createTRPCRouter({
const deletedComment = await cardCommentRepo.softDelete(ctx.db, {
commentId: existingComment.id,
deletedAt: new Date().toISOString(),
deletedAt: new Date(),
deletedBy: userId,
});

View File

@@ -37,7 +37,7 @@ export const userRouter = createTRPCRouter({
code: "UNAUTHORIZED",
});
const result = await userRepo.getById(ctx.drizzleDb, userId);
const result = await userRepo.getById(ctx.db, userId);
if (!result?.name) {
throw new TRPCError({