Files
formbricks/apps/web/lib/teams/mutateTeams.ts
T
Johannes 13508f42be Add Team switch (#259)
* 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>
2023-05-01 15:11:53 +02:00

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,
};
}