mirror of
https://github.com/formbricks/formbricks.git
synced 2026-04-23 05:17:49 -05:00
13508f42be
* add team switch when user has multiple teams * fix hydration error by changing the way env variables load --------- Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
12 lines
330 B
TypeScript
12 lines
330 B
TypeScript
import useSWRMutation from "swr/mutation";
|
|
import { updateRessource } from "@formbricks/lib/fetcher";
|
|
|
|
export function useTeamMutation(teamId: string) {
|
|
const { trigger, isMutating } = useSWRMutation(`/api/v1/teams/${teamId}`, updateRessource);
|
|
|
|
return {
|
|
triggerTeamMutate: trigger,
|
|
isMutatingTeam: isMutating,
|
|
};
|
|
}
|