mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 06:37:18 +01:00
Add owner column to admin website settings table
This commit is contained in:
parent
b756fcddf1
commit
9cff025784
3 changed files with 80 additions and 14 deletions
|
|
@ -115,6 +115,29 @@ export async function getUserWebsites(user_id) {
|
|||
);
|
||||
}
|
||||
|
||||
export async function getAllWebsites() {
|
||||
let data = await runQuery(
|
||||
prisma.website.findMany({
|
||||
orderBy: [
|
||||
{
|
||||
user_id: 'asc',
|
||||
},
|
||||
{
|
||||
name: 'asc',
|
||||
},
|
||||
],
|
||||
include: {
|
||||
account: {
|
||||
select: {
|
||||
username: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}),
|
||||
);
|
||||
return data.map(i => ({ ...i, account: i.account.username }));
|
||||
}
|
||||
|
||||
export async function createWebsite(user_id, data) {
|
||||
return runQuery(
|
||||
prisma.website.create({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue