From 649f1a39cef2bf0d44dacd981747df29798d46d2 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Thu, 23 Feb 2023 11:19:25 +0700 Subject: fix --- src/lib/auth/components/CompanyProfile.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/lib/auth/components') diff --git a/src/lib/auth/components/CompanyProfile.jsx b/src/lib/auth/components/CompanyProfile.jsx index 95575c87..f9f7fe13 100644 --- a/src/lib/auth/components/CompanyProfile.jsx +++ b/src/lib/auth/components/CompanyProfile.jsx @@ -5,6 +5,7 @@ import addressApi from '@/lib/address/api/addressApi' import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline' import { useEffect, useState } from 'react' import { Controller, useForm } from 'react-hook-form' +import { toast } from 'react-hot-toast' const CompanyProfile = () => { const auth = useAuth() @@ -58,7 +59,12 @@ const CompanyProfile = () => { tax_name: values.taxName }; const isUpdated = await odooApi('PUT', `/api/v1/partner/${auth.parentId}`, data) - console.log(isUpdated); + if (isUpdated?.id) { + setIsOpen(false) + toast.success('Berhasil mengubah profil', { duration: 1500 }) + return + } + toast.error('Terjadi kesalahan internal') } return ( -- cgit v1.2.3