File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
- import axios from 'axios' ;
2
1
import React from 'react' ;
3
2
import { Col , Container , Row , Button } from 'react-bootstrap' ;
4
3
import headerImage from '../../assets/tutoring.svg' ;
@@ -15,11 +14,15 @@ const meta = {
15
14
img : 'https://i.ibb.co/NTLFrdj/cougarcs-background11.jpg' ,
16
15
} ;
17
16
18
- const url = `${ process . env . REACT_APP_API_URL } /api/tutors` ;
17
+ const url =
18
+ process . env . NODE_ENV === 'development'
19
+ ? 'http://localhost:3000'
20
+ : 'https://api.cougarcs.com' ;
19
21
20
22
const fetchTutors = async ( ) => {
21
- const res = await axios . get ( url ) ;
22
- return res . data . tutors ;
23
+ const res = await fetch ( url + '/v1/tutors/names' ) ;
24
+ const { data } = await res . json ( ) ;
25
+ return data ;
23
26
} ;
24
27
25
28
const Tutoring = ( ) => {
@@ -28,7 +31,6 @@ const Tutoring = () => {
28
31
initialData : ( ) => queryClient . getQueryData ( 'tutors' ) ,
29
32
staleTime : 300000 ,
30
33
} ) ;
31
-
32
34
const displayTutors = ( ) => {
33
35
return isFetching ? (
34
36
< Loading />
@@ -45,7 +47,7 @@ const Tutoring = () => {
45
47
</ a >
46
48
</ div >
47
49
) : (
48
- < div key = { i } > { val . name } </ div >
50
+ < div key = { i } > { val . first_name + ' ' + val . last_name } </ div >
49
51
)
50
52
)
51
53
) ;
You can’t perform that action at this time.
0 commit comments