implemented the user view type and website sharing

This commit is contained in:
hsensh 2023-03-28 10:49:20 +03:00
parent 7a3443cd06
commit 66e67c7a3b
19 changed files with 260 additions and 68 deletions

View file

@ -3,5 +3,8 @@ import prisma from 'lib/prisma';
export async function getAccount(where) {
return prisma.client.account.findUnique({
where,
include: {
viewwebsites: true,
},
});
}

View file

@ -12,9 +12,11 @@ export async function getAccounts() {
id: true,
username: true,
isAdmin: true,
isViewer: true,
createdAt: true,
updatedAt: true,
accountUuid: true,
viewwebsites: true,
},
});
}

View file

@ -5,6 +5,9 @@ export async function getWebsite(where) {
return prisma.client.website
.findUnique({
where,
include: {
viewers: true,
},
})
.then(async data => {
if (redis.enabled && data) {