Skip to content

Commit 3bdb3f7

Browse files
committed
final fixes
1 parent 76a0a4e commit 3bdb3f7

2 files changed

Lines changed: 21 additions & 21 deletions

File tree

frontend/src/components/RiderComponents/RequestRideDialog.tsx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -477,24 +477,24 @@ const RequestRideDialog: React.FC<RequestRideDialogProps> = ({
477477
}));
478478
};
479479

480-
const createCustomLocation = async (name: string): Promise<Location> => {
481-
console.log('Creating new custom location:', name);
482-
483-
// Create new custom location
484-
const payload: Partial<Location> = {
485-
name: name.trim(),
486-
shortName: '',
487-
address: '', // Empty address for custom locations
488-
info: '',
489-
tag: Tag.CUSTOM,
490-
lat: 0, // Null coordinates for custom locations
491-
lng: 0,
492-
};
493-
494-
const response = await axios.post('/api/locations/custom', payload);
495-
const created: Location = response.data.data || response.data;
496-
console.log('Created custom location:', created);
497-
return created;
480+
const createCustomLocation = async (name: string): Promise<LocationType> => {
481+
console.log('Creating new custom location:', name);
482+
483+
// Create new custom location
484+
const payload: Partial<LocationType> = { // Change Location to LocationType
485+
name: name.trim(),
486+
shortName: '',
487+
address: '', // Empty address for custom locations
488+
info: '',
489+
tag: Tag.CUSTOM,
490+
lat: 0, // Null coordinates for custom locations
491+
lng: 0,
492+
};
493+
494+
const response = await axios.post('/api/locations/custom', payload);
495+
const created: LocationType = response.data.data || response.data; // Change Location to LocationType
496+
console.log('Created custom location:', created);
497+
return created;
498498
};
499499

500500
const handleSubmit = async () => {

frontend/src/components/UserTables/CancelledTable.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState, useEffect } from 'react';
2-
import { Ride } from '../../types/index';
2+
import { RideType } from '@carriage-web/shared/types/ride';
33
import RidesTable from './RidesTable';
44
import styles from './table.module.css';
55
import { useEmployees } from '../../context/EmployeesContext';
@@ -11,10 +11,10 @@ type CancelledTableProp = {
1111

1212
const CancelledTable = () => {
1313
const { drivers } = useEmployees();
14-
const [rides, setRides] = useState<Ride[]>([]);
14+
const [rides, setRides] = useState<RideType[]>([]);
1515
const { cancelledRides } = useRides();
1616

17-
const compRides = (a: Ride, b: Ride) => {
17+
const compRides = (a: RideType, b: RideType) => {
1818
const x = new Date(a.startTime);
1919
const y = new Date(b.startTime);
2020
if (x < y) return -1;

0 commit comments

Comments
 (0)