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:
Benny Joo authored and GitHub committed 2024-09-17 02:42:19 +00:00
1 parent 4cbf9ec9ab
commit f86a5db843
7 files changed
+271 -250

No files matched your search

+28
View File
@@ -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;
}
}