Enforce cloud website limits by subscription tier
This commit is contained in:
1 parent
7d4c68cebe
commit
c41bf7c93e
4 files changed
+73
-10
No files matched your search
@@ -46,7 +46,10 @@ export async function getWebsites(criteria: Prisma.WebsiteFindManyArgs, filters:
|
||||
return attachShareIdToWebsites(websites);
|
||||
}
|
||||
|
||||
export async function getAllUserWebsitesIncludingTeamAccess(userId: string, filters?: QueryFilters) {
|
||||
export async function getAllUserWebsitesIncludingTeamAccess(
|
||||
userId: string,
|
||||
filters?: QueryFilters,
|
||||
) {
|
||||
return getWebsites(
|
||||
{
|
||||
where: {
|
||||
@@ -263,6 +266,15 @@ export async function getWebsiteCount(userId: string) {
|
||||
});
|
||||
}
|
||||
|
||||
export async function getTeamWebsiteCount(teamId: string) {
|
||||
return prisma.client.website.count({
|
||||
where: {
|
||||
teamId,
|
||||
deletedAt: null,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function attachShareIdToWebsite(website: Website) {
|
||||
const share = await prisma.client.share.findFirst({
|
||||
where: {
|
||||
|
||||
Reference in new issue
Block a user