mirror of
https://github.com/umami-software/umami.git
synced 2026-02-16 02:25:35 +01:00
Convert useModified into a real hook.
This commit is contained in:
parent
a426c242cb
commit
91e3dff7f5
24 changed files with 63 additions and 48 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import { useApi, useMessages } from 'components/hooks';
|
||||
import { useApi, useMessages, useModified } from 'components/hooks';
|
||||
import { Icon, Icons, LoadingButton, Text } from 'react-basics';
|
||||
import { touch } from 'store/modified';
|
||||
|
||||
export function TeamMemberRemoveButton({
|
||||
teamId,
|
||||
|
|
@ -18,6 +17,7 @@ export function TeamMemberRemoveButton({
|
|||
const { mutate, isPending } = useMutation({
|
||||
mutationFn: () => del(`/teams/${teamId}/users/${userId}`),
|
||||
});
|
||||
const { touch } = useModified();
|
||||
|
||||
const handleRemoveTeamMember = () => {
|
||||
mutate(null, {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import { useMessages } from 'components/hooks';
|
||||
import { useMessages, useModified } from 'components/hooks';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { ActionForm, Button, Modal, ModalTrigger } from 'react-basics';
|
||||
import TeamDeleteForm from './TeamDeleteForm';
|
||||
import { touch } from 'store/modified';
|
||||
|
||||
export function TeamAdmin({ teamId }: { teamId: string }) {
|
||||
const { formatMessage, labels, messages } = useMessages();
|
||||
const router = useRouter();
|
||||
const { touch } = useModified();
|
||||
|
||||
const handleLeave = async () => {
|
||||
touch('teams');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue