mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-25 16:31:13 -05:00
Refactor: Fix type safety and auth
This commit is contained in:
@@ -105,7 +105,16 @@ export default function ManufacturerRides() {
|
||||
return;
|
||||
}
|
||||
|
||||
const submissionData = {
|
||||
if (!manufacturer) {
|
||||
toast({
|
||||
title: "Error",
|
||||
description: "Manufacturer information is missing.",
|
||||
variant: "destructive"
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const submissionData: RideSubmissionData = {
|
||||
...data,
|
||||
manufacturer_id: manufacturer.id,
|
||||
};
|
||||
@@ -200,10 +209,12 @@ export default function ManufacturerRides() {
|
||||
<FerrisWheel className="w-8 h-8 text-primary" />
|
||||
<h1 className="text-4xl font-bold">Rides by {manufacturer.name}</h1>
|
||||
</div>
|
||||
<Button onClick={() => setIsCreateModalOpen(true)}>
|
||||
<Plus className="w-4 h-4 mr-2" />
|
||||
Add Ride
|
||||
</Button>
|
||||
{user && (
|
||||
<Button onClick={() => setIsCreateModalOpen(true)}>
|
||||
<Plus className="w-4 h-4 mr-2" />
|
||||
Add Ride
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
<p className="text-lg text-muted-foreground mb-4">
|
||||
Explore all rides manufactured by {manufacturer.name}
|
||||
|
||||
Reference in New Issue
Block a user