Add user role api.

This commit is contained in:
Brian Cao 2022-11-20 22:24:31 -08:00
parent 78225691df
commit 8fc6e99aa8
3 changed files with 82 additions and 2 deletions

View file

@ -21,6 +21,15 @@ export async function getUserRoles(where: Prisma.UserRoleWhereInput): Promise<Us
});
}
export async function getUserRolesByUserId(userId: string, teamId?: string): Promise<UserRole[]> {
return prisma.client.userRole.findMany({
where: {
userId,
teamId,
},
});
}
export async function updateUserRole(
data: Prisma.UserRoleUpdateInput,
where: Prisma.UserRoleWhereUniqueInput,

View file

@ -2,10 +2,8 @@ export * from './admin/permission';
export * from './admin/role';
export * from './admin/team';
export * from './admin/teamUser';
export * from './admin/teamWebsite';
export * from './admin/user';
export * from './admin/userRole';
export * from './admin/userWebsite';
export * from './admin/website';
export * from './analytics/event/getEventMetrics';
export * from './analytics/event/getEvents';