mirror of
https://github.com/umami-software/umami.git
synced 2026-02-15 01:55:36 +01:00
Fixed team data not refreshing.
This commit is contained in:
parent
b0c9197f2d
commit
2109d3225e
1 changed files with 3 additions and 1 deletions
|
|
@ -11,7 +11,7 @@ import {
|
||||||
} from 'react-basics';
|
} from 'react-basics';
|
||||||
import { getRandomChars } from 'next-basics';
|
import { getRandomChars } from 'next-basics';
|
||||||
import { useContext, useRef, useState } from 'react';
|
import { useContext, useRef, useState } from 'react';
|
||||||
import { useApi, useMessages } from 'components/hooks';
|
import { useApi, useMessages, useModified } from 'components/hooks';
|
||||||
import { TeamContext } from 'app/(main)/teams/[teamId]/TeamProvider';
|
import { TeamContext } from 'app/(main)/teams/[teamId]/TeamProvider';
|
||||||
|
|
||||||
const generateId = () => getRandomChars(16);
|
const generateId = () => getRandomChars(16);
|
||||||
|
|
@ -26,12 +26,14 @@ export function TeamEditForm({ teamId, allowEdit }: { teamId: string; allowEdit?
|
||||||
const ref = useRef(null);
|
const ref = useRef(null);
|
||||||
const [accessCode, setAccessCode] = useState(team.accessCode);
|
const [accessCode, setAccessCode] = useState(team.accessCode);
|
||||||
const { showToast } = useToasts();
|
const { showToast } = useToasts();
|
||||||
|
const { touch } = useModified();
|
||||||
const cloudMode = !!process.env.cloudMode;
|
const cloudMode = !!process.env.cloudMode;
|
||||||
|
|
||||||
const handleSubmit = async (data: any) => {
|
const handleSubmit = async (data: any) => {
|
||||||
mutate(data, {
|
mutate(data, {
|
||||||
onSuccess: async () => {
|
onSuccess: async () => {
|
||||||
ref.current.reset(data);
|
ref.current.reset(data);
|
||||||
|
touch('teams');
|
||||||
showToast({ message: formatMessage(messages.saved), variant: 'success' });
|
showToast({ message: formatMessage(messages.saved), variant: 'success' });
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue