refactor: update temps

This commit is contained in:
Mauricio Siu
2025-02-13 01:24:25 -06:00
parent 140a871275
commit 74ee024cf9
2 changed files with 7 additions and 2 deletions

View File

@@ -94,6 +94,10 @@ export default function Home({ IS_CLOUD }: Props) {
});
// router.push("/dashboard/projects");
// }
} else {
toast.error("Error to sign up", {
description: error.message,
});
}
console.log(data, error);

View File

@@ -18,15 +18,16 @@ export const auth = betterAuth({
if (ctx.path.startsWith("/sign-up")) {
const newSession = ctx.context.newSession;
await db
.update(schema.user)
.update(schema.users_temp)
.set({
role: "admin",
})
.where(eq(schema.user.id, newSession?.user?.id || ""));
.where(eq(schema.users_temp.id, newSession?.user?.id || ""));
}
}),
},
user: {
modelName: "users_temp",
additionalFields: {},
},
plugins: [organization()],