File tree 1 file changed +16
-0
lines changed
frontend/src/pages/Admin/Components/Contact
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ export function Contact() {
16
16
toastMessage : "" ,
17
17
} ) ;
18
18
const fetchJoinUs = async ( ) => {
19
+ setIsLoaded ( true ) ;
20
+ try {
19
21
const response = await fetch ( `${ END_POINT } /contactus/getcontactus` , {
20
22
method : "GET" ,
21
23
headers : {
@@ -25,6 +27,20 @@ export function Contact() {
25
27
} ) ;
26
28
const data = await response . json ( ) ;
27
29
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
+ }
28
44
setIsLoaded ( false ) ;
29
45
} ;
30
46
const handleCloseToast = ( event , reason ) => {
You can’t perform that action at this time.
0 commit comments