mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 06:37:18 +01:00
Updated teams button.
This commit is contained in:
parent
8048bc7866
commit
44393472cf
12 changed files with 46 additions and 55 deletions
|
|
@ -2,16 +2,11 @@ import { NextApiRequestAuth } from 'lib/types';
|
|||
import { useAuth } from 'lib/middleware';
|
||||
import { NextApiResponse } from 'next';
|
||||
import { ok } from 'next-basics';
|
||||
import { getUserTeams } from 'queries/admin/team';
|
||||
|
||||
export default async (req: NextApiRequestAuth, res: NextApiResponse) => {
|
||||
await useAuth(req, res);
|
||||
|
||||
const { user } = req.auth;
|
||||
|
||||
const teams = await getUserTeams(user.id);
|
||||
|
||||
user['teams'] = teams.data.map(n => n);
|
||||
|
||||
return ok(res, user);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue