mirror of
https://github.com/umami-software/umami.git
synced 2026-02-14 09:35:36 +01:00
Add permission checks.
This commit is contained in:
parent
51e2331315
commit
78225691df
20 changed files with 225 additions and 333 deletions
|
|
@ -21,17 +21,17 @@ export default async (
|
|||
} = req.auth;
|
||||
|
||||
if (req.method === 'GET') {
|
||||
const users = await getTeamsByUserId(id);
|
||||
const teams = await getTeamsByUserId(id);
|
||||
|
||||
return ok(res, users);
|
||||
return ok(res, teams);
|
||||
}
|
||||
|
||||
if (req.method === 'POST') {
|
||||
const { name } = req.body;
|
||||
|
||||
const user = await getTeam({ name });
|
||||
const team = await getTeam({ name });
|
||||
|
||||
if (user) {
|
||||
if (team) {
|
||||
return badRequest(res, 'Team already exists');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue