Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

586 B
Raw Blame
import { useMutation } from '@tanstack/react-query';
import { t } from 'i18next';
import { toast } from 'sonner';

import { platformApi } from '@/api/platforms-api';

export const brandingMutations = {
  useUpdateAppearance: ({ platformId }: { platformId: string }) => {
    return useMutation({
      mutationFn: async (formData: FormData) => {
        await platformApi.updateWithFormData(formData, platformId);
        window.location.reload();
      },
      onSuccess: () => {
        toast.success(t('Your changes have been saved.'), { duration: 3000 });
      },
    });
  },
};