mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 12:18:11 +00:00
Package passenger numbers and pricing updates
This commit is contained in:
@@ -116,7 +116,7 @@ export default function PricingPage() {
|
||||
|
||||
const { data: segmentFares = [], isLoading: segmentFaresLoading, refetch: refetchSegmentFares } = useQuery({
|
||||
queryKey: ['segment-fares', selectedRoute],
|
||||
queryFn: () => (selectedRoute ? apiClient.get(`/schedules/routes/${selectedRoute}/segment-fares`) : Promise.resolve([])),
|
||||
queryFn: () => (selectedRoute ? apiClient.get(`/admin/segment-fares?routeId=${selectedRoute}`) : Promise.resolve([])),
|
||||
enabled: !!selectedRoute && tab === 'segment',
|
||||
});
|
||||
|
||||
@@ -199,7 +199,7 @@ export default function PricingPage() {
|
||||
});
|
||||
|
||||
const createSegmentFareMutation = useMutation({
|
||||
mutationFn: (data: any) => apiClient.post(`/schedules/segment-fares`, data),
|
||||
mutationFn: (data: any) => apiClient.post(`/admin/segment-fares`, data),
|
||||
onSuccess: () => {
|
||||
refetchSegmentFares();
|
||||
resetSegmentForm();
|
||||
@@ -211,7 +211,7 @@ export default function PricingPage() {
|
||||
});
|
||||
|
||||
const updateSegmentFareMutation = useMutation({
|
||||
mutationFn: (data: any) => apiClient.patch(`/schedules/segment-fares/${data.id}`, data),
|
||||
mutationFn: ({ id, ...data }: any) => apiClient.put(`/admin/segment-fares/${id}`, data),
|
||||
onSuccess: () => {
|
||||
refetchSegmentFares();
|
||||
setEditingFare(null);
|
||||
@@ -224,7 +224,7 @@ export default function PricingPage() {
|
||||
});
|
||||
|
||||
const deleteSegmentFareMutation = useMutation({
|
||||
mutationFn: (id: string) => apiClient.delete(`/schedules/segment-fares/${id}`),
|
||||
mutationFn: (id: string) => apiClient.delete(`/admin/segment-fares/${id}`),
|
||||
onSuccess: () => {
|
||||
refetchSegmentFares();
|
||||
setDeleteConfirm({ isOpen: false, id: null });
|
||||
@@ -422,7 +422,7 @@ export default function PricingPage() {
|
||||
},
|
||||
{
|
||||
key: 'baseFare',
|
||||
label: 'Fare (ETB)',
|
||||
label: 'Fare',
|
||||
render: (fare: any) => {
|
||||
const minor = fare.baseFareMinor ?? fare.baseFare;
|
||||
if (minor == null) return <span className="text-muted-foreground">—</span>;
|
||||
@@ -495,7 +495,7 @@ export default function PricingPage() {
|
||||
},
|
||||
{
|
||||
key: 'baseFare',
|
||||
label: 'Fare (ETB)',
|
||||
label: 'Fare',
|
||||
render: (fare: any) => {
|
||||
const fareValue = fare.baseFare ?? fare.baseFareMinor;
|
||||
if (fareValue == null) return <span className="text-muted-foreground">—</span>;
|
||||
@@ -870,7 +870,7 @@ export default function PricingPage() {
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="label">Fare (ETB) *</label>
|
||||
<label className="label">Fare *</label>
|
||||
<input
|
||||
type="number"
|
||||
min="0"
|
||||
@@ -1000,7 +1000,7 @@ export default function PricingPage() {
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="label">Fare (ETB) *</label>
|
||||
<label className="label">Fare *</label>
|
||||
<input
|
||||
type="number"
|
||||
min="0"
|
||||
|
||||
Reference in New Issue
Block a user