mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 14:17:13 +01:00
Allow getting team websites.
This commit is contained in:
parent
e610de383a
commit
433ce98719
10 changed files with 79 additions and 56 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { z } from 'zod';
|
||||
import { pagingParams } from '@/lib/schema';
|
||||
import { getUserWebsites } from '@/queries';
|
||||
import { getAllUserWebsitesIncludingTeamOwner, getUserWebsites } from '@/queries';
|
||||
import { json } from '@/lib/response';
|
||||
import { parseRequest, getQueryFilters } from '@/lib/request';
|
||||
|
||||
|
|
@ -17,7 +17,9 @@ export async function GET(request: Request) {
|
|||
|
||||
const filters = await getQueryFilters(query);
|
||||
|
||||
const websites = await getUserWebsites(auth.user.id, filters);
|
||||
if (query.includeTeams) {
|
||||
return json(await getAllUserWebsitesIncludingTeamOwner(auth.user.id, filters));
|
||||
}
|
||||
|
||||
return json(websites);
|
||||
return json(await getUserWebsites(auth.user.id, filters));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,5 +40,5 @@ export async function GET(
|
|||
endDate,
|
||||
});
|
||||
|
||||
return json({ ...data[0], comparison });
|
||||
return json({ ...data, comparison });
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue