mirror of
https://github.com/umami-software/umami.git
synced 2026-02-15 01:55:36 +01:00
Added different methods to get user websites and teams.
This commit is contained in:
parent
5189486d6f
commit
f4aa8f9661
5 changed files with 58 additions and 12 deletions
15
pages/api/me/teams.ts
Normal file
15
pages/api/me/teams.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { useCors } from 'lib/middleware';
|
||||
import { NextApiRequestQueryBody } from 'lib/types';
|
||||
import { NextApiResponse } from 'next';
|
||||
import { methodNotAllowed } from 'next-basics';
|
||||
import userTeams from 'pages/api/users/[id]/teams';
|
||||
|
||||
export default async (req: NextApiRequestQueryBody, res: NextApiResponse) => {
|
||||
await useCors(req, res);
|
||||
|
||||
if (req.method === 'GET') {
|
||||
return userTeams(req, res);
|
||||
}
|
||||
|
||||
return methodNotAllowed(res);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue