From 3fbcfe5797ff7ebbca8240032849410bce732bd6 Mon Sep 17 00:00:00 2001 From: Ebube Date: Tue, 9 Jan 2024 13:30:32 +0100 Subject: [PATCH] Done for now --- src/components/YourPage/YourPageForm.jsx | 6 +++--- src/components/YourPage/index.jsx | 16 +++++++++------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/components/YourPage/YourPageForm.jsx b/src/components/YourPage/YourPageForm.jsx index 0074c17..5dea482 100644 --- a/src/components/YourPage/YourPageForm.jsx +++ b/src/components/YourPage/YourPageForm.jsx @@ -2,13 +2,13 @@ import InputCom from "../Helpers/Inputs/InputCom/index"; import UpdateButton from "./UpdateButton"; const YourPageForm = ({ values, onChange, onSubmit, loading }) => ( -
+
{ let api = new usersService(); const res = await api.MyPageIntro(pageValues); - setResponse({ - loading: false, - data: res.data, - msg: "Page updated successfully", - }); + setTimeout(() => { + setResponse({ + loading: false, + data: res.data, + msg: "Page updated successfully", + }); - // Clear form after successful update - setPageValues({ intro: "", description: "" }); + // Clear form after successful update + setPageValues({ intro: "", description: "" }); + }, 2000); } catch (error) { setResponse({ loading: false,