chore: App Router Migration, add metadata to getting-started, extract into /modules and add method to UserRepository (#16449)
* getting-started: extract into /modules * fix * fix type-check * add findByIdWithOptionalSelect to UserRepository * fix import error * fix type check * add metadata * fix
This commit is contained in:
1 parent
4cbf9ec9ab
commit
f86a5db843
7 files changed
+271
-250
No files matched your search
@@ -585,4 +585,32 @@ export class UserRepository {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
static async findUserTeams({ id }: { id: number }) {
|
||||
const user = await prisma.user.findUnique({
|
||||
where: {
|
||||
id,
|
||||
},
|
||||
select: {
|
||||
completedOnboarding: true,
|
||||
teams: {
|
||||
select: {
|
||||
accepted: true,
|
||||
team: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
logoUrl: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (!user) {
|
||||
return null;
|
||||
}
|
||||
return user;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user