mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 15:17:23 +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
|
|
@ -1,4 +1,4 @@
|
|||
import { getUserWebsites } from 'lib/queries';
|
||||
import { getAllWebsites, getUserWebsites } from 'lib/queries';
|
||||
import { useAuth } from 'lib/middleware';
|
||||
import { ok, methodNotAllowed, unauthorized } from 'lib/response';
|
||||
|
||||
|
|
@ -6,7 +6,7 @@ export default async (req, res) => {
|
|||
await useAuth(req, res);
|
||||
|
||||
const { user_id: current_user_id, is_admin } = req.auth;
|
||||
const { user_id } = req.query;
|
||||
const { user_id, include_all } = req.query;
|
||||
const userId = +user_id;
|
||||
|
||||
if (req.method === 'GET') {
|
||||
|
|
@ -14,7 +14,10 @@ export default async (req, res) => {
|
|||
return unauthorized(res);
|
||||
}
|
||||
|
||||
const websites = await getUserWebsites(userId || current_user_id);
|
||||
const websites =
|
||||
is_admin && include_all
|
||||
? await getAllWebsites()
|
||||
: await getUserWebsites(userId || current_user_id);
|
||||
|
||||
return ok(res, websites);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue