mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Api work for remove user.
This commit is contained in:
parent
f4f657b666
commit
7b07de7a98
4 changed files with 15 additions and 45 deletions
|
|
@ -62,23 +62,22 @@ export async function updateTeamUser(
|
|||
});
|
||||
}
|
||||
|
||||
export async function deleteTeamUser(teamUserId: string): Promise<TeamUser> {
|
||||
export async function deleteTeamUser(teamId: string, userId: string): Promise<TeamUser> {
|
||||
const { client, transaction } = prisma;
|
||||
|
||||
const teamUser = await getTeamUserById(teamUserId);
|
||||
|
||||
return transaction([
|
||||
client.teamWebsite.deleteMany({
|
||||
where: {
|
||||
teamId: teamUser.teamId,
|
||||
teamId: teamId,
|
||||
website: {
|
||||
userId: teamUser.userId,
|
||||
userId: userId,
|
||||
},
|
||||
},
|
||||
}),
|
||||
client.teamUser.deleteMany({
|
||||
where: {
|
||||
id: teamUserId,
|
||||
teamId,
|
||||
userId,
|
||||
},
|
||||
}),
|
||||
]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue