feat: migrate templates and documents to envelope model

This commit is contained in:
David Nguyen
2025-09-11 18:23:38 +10:00
parent eec2307634
commit bf89bc781b
234 changed files with 8677 additions and 6054 deletions

View File

@ -21,7 +21,14 @@ type GetMemberRolesOptions = {
* Returns the highest Team role of a given member or user of a team
*/
export const getMemberRoles = async ({ teamId, reference }: GetMemberRolesOptions) => {
const team = await prisma.team.findFirst({
// Enforce incase teamId undefined slips through due to invalid types.
if (teamId === undefined) {
throw new AppError(AppErrorCode.NOT_FOUND, {
message: 'Team not found',
});
}
const team = await prisma.team.findUnique({
where: {
id: teamId,
},