refactor: update repo funcs to drizzle
This commit is contained in:
@@ -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: {
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user