diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-02-23 11:19:25 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-02-23 11:19:25 +0700 |
| commit | 649f1a39cef2bf0d44dacd981747df29798d46d2 (patch) | |
| tree | fdc982c40b65494a56dce8531fb9708b1df1e293 /src/lib | |
| parent | 0de0fda98dc35bd6503f1a45a52878b154a94c75 (diff) | |
fix
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/auth/components/CompanyProfile.jsx | 8 |
1 files changed, 7 insertions, 1 deletions
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 ( |
