mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 03:55:37 +01:00
Admin section updates.
This commit is contained in:
parent
87449ece9e
commit
1b81074752
20 changed files with 274 additions and 647 deletions
|
|
@ -19,19 +19,21 @@ export function WebsiteData({ websiteId, onSave }: { websiteId: string; onSave?:
|
|||
const { touch } = useModified();
|
||||
const { teamId, renderUrl } = useNavigation();
|
||||
const router = useRouter();
|
||||
const { data } = useUserTeamsQuery(user.id);
|
||||
const { data: teams } = useUserTeamsQuery(user.id);
|
||||
|
||||
const canTransferWebsite =
|
||||
(
|
||||
!teamId &&
|
||||
data.filter(({ teamUser }) =>
|
||||
teamUser.find(
|
||||
({ role, userId }) =>
|
||||
[ROLES.teamOwner, ROLES.teamManager].includes(role) && userId === user.id,
|
||||
),
|
||||
)
|
||||
(!teamId &&
|
||||
teams?.data?.filter(({ teamUser }) =>
|
||||
teamUser.find(
|
||||
({ role, userId }) =>
|
||||
[ROLES.teamOwner, ROLES.teamManager].includes(role) && userId === user.id,
|
||||
),
|
||||
)) ||
|
||||
[]
|
||||
).length > 0 ||
|
||||
(teamId &&
|
||||
!!data
|
||||
!!teams?.data
|
||||
?.find(({ id }) => id === teamId)
|
||||
?.teamUser.find(({ role, userId }) => role === ROLES.teamOwner && userId === user.id));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue