mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 08:37:13 +01:00
Add queries for new schema.
This commit is contained in:
parent
b0c7980a20
commit
5aa8187e42
25 changed files with 699 additions and 306 deletions
43
queries/admin/teamWebsite.ts
Normal file
43
queries/admin/teamWebsite.ts
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import { Prisma, TeamWebsite } from '@prisma/client';
|
||||
import prisma from 'lib/prisma';
|
||||
|
||||
export async function createTeamWebsite(data: Prisma.TeamWebsiteCreateInput): Promise<TeamWebsite> {
|
||||
return prisma.client.teamWebsite.create({
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export async function getTeamWebsite(
|
||||
where: Prisma.TeamWebsiteWhereUniqueInput,
|
||||
): Promise<TeamWebsite> {
|
||||
return prisma.client.teamWebsite.findUnique({
|
||||
where,
|
||||
});
|
||||
}
|
||||
|
||||
export async function getTeamWebsites(where: Prisma.TeamWebsiteWhereInput): Promise<TeamWebsite[]> {
|
||||
return prisma.client.teamWebsite.findMany({
|
||||
where,
|
||||
});
|
||||
}
|
||||
|
||||
export async function updateTeamWebsite(
|
||||
data: Prisma.TeamWebsiteUpdateInput,
|
||||
where: Prisma.TeamWebsiteWhereUniqueInput,
|
||||
): Promise<TeamWebsite> {
|
||||
return prisma.client.teamWebsite.update({
|
||||
data,
|
||||
where,
|
||||
});
|
||||
}
|
||||
|
||||
export async function deleteTeamWebsite(teamWebsiteId: string): Promise<TeamWebsite> {
|
||||
return prisma.client.teamWebsite.update({
|
||||
data: {
|
||||
isDeleted: true,
|
||||
},
|
||||
where: {
|
||||
id: teamWebsiteId,
|
||||
},
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue