Skip to content

Commit d7d5677

Browse files
authored
Update Contact.jsx
1 parent 562cafe commit d7d5677

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

frontend/src/pages/Admin/Components/Contact/Contact.jsx

+16
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ export function Contact() {
1616
toastMessage: "",
1717
});
1818
const fetchJoinUs = async () => {
19+
setIsLoaded(true);
20+
try{
1921
const response = await fetch(`${END_POINT}/contactus/getcontactus`, {
2022
method: "GET",
2123
headers: {
@@ -25,6 +27,20 @@ export function Contact() {
2527
});
2628
const data = await response.json();
2729
setContactUsData(data.ContactUs);
30+
setToast({
31+
...toast,
32+
toastMessage: "Successfully get data!",
33+
toastStatus: true,
34+
toastType: "success",
35+
});
36+
}catch(error){
37+
setToast({
38+
...toast,
39+
toastMessage: "Unable to get data!",
40+
toastStatus: true,
41+
toastType: "error",
42+
});
43+
}
2844
setIsLoaded(false);
2945
};
3046
const handleCloseToast = (event, reason) => {

0 commit comments

Comments
 (0)