Skip to content

Commit 4430843

Browse files
committed
update tutor names
1 parent ad89483 commit 4430843

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/pages/Tutoring/Tutoring.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import axios from 'axios';
21
import React from 'react';
32
import { Col, Container, Row, Button } from 'react-bootstrap';
43
import headerImage from '../../assets/tutoring.svg';
@@ -15,11 +14,15 @@ const meta = {
1514
img: 'https://i.ibb.co/NTLFrdj/cougarcs-background11.jpg',
1615
};
1716

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';
1921

2022
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;
2326
};
2427

2528
const Tutoring = () => {
@@ -28,7 +31,6 @@ const Tutoring = () => {
2831
initialData: () => queryClient.getQueryData('tutors'),
2932
staleTime: 300000,
3033
});
31-
3234
const displayTutors = () => {
3335
return isFetching ? (
3436
<Loading />
@@ -45,7 +47,7 @@ const Tutoring = () => {
4547
</a>
4648
</div>
4749
) : (
48-
<div key={i}>{val.name}</div>
50+
<div key={i}>{val.first_name + ' ' + val.last_name}</div>
4951
)
5052
)
5153
);

0 commit comments

Comments
 (0)