mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 15:17:23 +01:00
Renamed id routes for API.
This commit is contained in:
parent
53a991176b
commit
4429198397
42 changed files with 154 additions and 170 deletions
|
|
@ -84,7 +84,7 @@ export async function getReports(
|
|||
],
|
||||
};
|
||||
|
||||
return prisma.pagedQuery('report', { where }, filters);
|
||||
return prisma.pagedQuery('report', { ...criteria, where }, filters);
|
||||
}
|
||||
|
||||
export async function getUserReports(
|
||||
|
|
|
|||
|
|
@ -50,6 +50,17 @@ export async function createTeamUser(
|
|||
});
|
||||
}
|
||||
|
||||
export async function updateTeamUser(teamUserId: string, data: any): Promise<TeamUser> {
|
||||
return prisma.client.teamUser.update(
|
||||
{
|
||||
where: {
|
||||
id: teamUserId,
|
||||
},
|
||||
},
|
||||
data,
|
||||
);
|
||||
}
|
||||
|
||||
export async function deleteTeamUser(teamId: string, userId: string): Promise<TeamUser> {
|
||||
const { client } = prisma;
|
||||
|
||||
|
|
|
|||
|
|
@ -112,12 +112,11 @@ export async function createUser(data: {
|
|||
});
|
||||
}
|
||||
|
||||
export async function updateUser(
|
||||
data: Prisma.UserUpdateInput,
|
||||
where: Prisma.UserWhereUniqueInput,
|
||||
): Promise<User> {
|
||||
export async function updateUser(userId: string, data: Prisma.UserUpdateInput): Promise<User> {
|
||||
return prisma.client.user.update({
|
||||
where,
|
||||
where: {
|
||||
id: userId,
|
||||
},
|
||||
data,
|
||||
select: {
|
||||
id: true,
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ export async function updateWebsite(
|
|||
): Promise<Website> {
|
||||
return prisma.client.website.update({
|
||||
where: {
|
||||
id: websiteId,
|
||||
websiteId,
|
||||
},
|
||||
data,
|
||||
});
|
||||
|
|
@ -160,7 +160,7 @@ export async function resetWebsite(
|
|||
where: { websiteId },
|
||||
}),
|
||||
client.website.update({
|
||||
where: { id: websiteId },
|
||||
where: { websiteId },
|
||||
data: {
|
||||
resetAt: new Date(),
|
||||
},
|
||||
|
|
@ -200,10 +200,10 @@ export async function deleteWebsite(
|
|||
data: {
|
||||
deletedAt: new Date(),
|
||||
},
|
||||
where: { id: websiteId },
|
||||
where: { websiteId },
|
||||
})
|
||||
: client.website.delete({
|
||||
where: { id: websiteId },
|
||||
where: { websiteId },
|
||||
}),
|
||||
]).then(async data => {
|
||||
if (cache.enabled) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue