Skip to content

Commit

Permalink
fix eslint warning
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdisungkar committed May 27, 2024
1 parent 12a3842 commit 4dd2141
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
9 changes: 3 additions & 6 deletions application/app/frontend/src/components/RideRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ function RideRequest() {
const [errors, setErrors] = useState({});
const [tripRequestId, setTripRequestId] = useState('');
const navigate = useNavigate();
const tripInfo = (tripRequestId) => {
navigate(`/trip-info/${tripRequestId}`);
};

const handleTimeChange = (event) => {
const { name, value } = event.target;
Expand Down Expand Up @@ -96,10 +93,10 @@ function RideRequest() {

useEffect(() => {
console.log('API response updated:', tripRequestId);
if (tripRequestId != '') {
tripInfo(tripRequestId);
if (tripRequestId !== '') {
navigate(`/trip-info/${tripRequestId}`);
}
}, [tripRequestId]);
}, [tripRequestId, navigate]);

const handleLogout = () => {
setUser(null);
Expand Down
2 changes: 1 addition & 1 deletion application/app/frontend/src/pages/TripsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const TripsPage = () => {
};

fetchTrips();
}, [user.username]);
}, [user.username, tripId]);

const fetchTripDetails = async (trip_id) => {
try {
Expand Down
6 changes: 3 additions & 3 deletions endpoint.http
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ POST {{baseUrl}}/trip_request/create
Content-Type: application/json

{
"username": "jDoe12",
"username": "passenger",
"pickup_location": {"latitude": 37.7749, "longitude": -123.4194, "address": "123 street road, brisbane, qld"},
"dropoff_location": {"latitude": 37.7749, "longitude": -123.4194, "address": "125 street road, brisbane, qld"},
"pickup_window_start": "2024-05-11T07:30:00",
Expand Down Expand Up @@ -207,8 +207,8 @@ Content-Type: application/json

{
"username": "driver",
"trip_request_id": "8db16b8e-e585-49dd-a9ff-fd31535a8103",
"trip_id": "411ea3fa-2ba2-4aab-9df1-7f19b8c27898"
"trip_request_id": "7730b79f-7aa9-4682-a0ba-da4257860682",
"trip_id": "8da7168d-81df-4ded-9681-9be7acd20ddb"
}

### GET THE TEST
Expand Down

0 comments on commit 4dd2141

Please sign in to comment.