refactor: add organizations system

This commit is contained in:
Mauricio Siu
2025-02-09 20:53:06 -06:00
parent fafc238e70
commit 8bd72a8a34
47 changed files with 359 additions and 171 deletions

View File

@@ -20,18 +20,16 @@ export const findUserById = async (userId: string) => {
export const findUserByAuthId = async (authId: string) => {
const userR = await db.query.user.findFirst({
where: eq(user.authId, authId),
with: {
auth: true,
},
where: eq(user.id, authId),
with: {},
});
if (!user) {
if (!userR) {
throw new TRPCError({
code: "NOT_FOUND",
message: "User not found",
});
}
return user;
return userR;
};
export const findUsers = async (adminId: string) => {