From 4d50e60d9e75331a8abb55f36b665f6f9886b809 Mon Sep 17 00:00:00 2001 From: muhamad fais aizat Date: Sat, 3 May 2025 01:04:18 +0700 Subject: [PATCH] feactdata: menyambungkan api setting --- .../__pycache__/testingModel.cpython-310.pyc | Bin 4277 -> 4277 bytes frontend/src/pages/Panel/Setting/Setting.jsx | 17 ++++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/backend/routes/__pycache__/testingModel.cpython-310.pyc b/backend/routes/__pycache__/testingModel.cpython-310.pyc index 45bf28f40949f6a0de134f07f75ac6c02cbc4058..aac059be5ce5726619fc43f900423e0316452c06 100644 GIT binary patch delta 20 acmdn0xK)umpO=@50SH!n7um?YN&o;itp#)d delta 20 acmdn0xK)umpO=@50SF@Y3UB0IB>(_490chA diff --git a/frontend/src/pages/Panel/Setting/Setting.jsx b/frontend/src/pages/Panel/Setting/Setting.jsx index 81a147a4..5cc75ad8 100644 --- a/frontend/src/pages/Panel/Setting/Setting.jsx +++ b/frontend/src/pages/Panel/Setting/Setting.jsx @@ -8,6 +8,7 @@ import { API_URL } from "../../../helpers/networt"; import { useToast } from '@/hooks/use-toast'; const Setting = () => { + const [isLoading, setIsLoading] = useState(false); const { toast } = useToast(); const getemail = localStorage.getItem("email"); const idUser = localStorage.getItem("idUser"); @@ -87,6 +88,7 @@ const Setting = () => { } const handleSaveDataKernel = async () => { + setIsLoading(true); const token = localStorage.getItem("token"); console.log(selectedKernelfalse) console.log(selectedKernel) @@ -166,6 +168,17 @@ const Setting = () => { ); } + const hasil = await axios.get( + `${API_URL}/predict/price`, + { + headers: { + "Content-Type": "application/json", + Accept: "application/json", + Authorization: `Bearer ${token}`, + }, + } + ); + toast({ description: "Pengaturan model berhasil disimpan", }); @@ -178,6 +191,8 @@ const Setting = () => { description: `${error.response.data.detail}`, variant: "destructive", }); + } finally { + setIsLoading(false); } } return ( @@ -340,7 +355,7 @@ const Setting = () => {
- +