Refactor: Fix type safety and auth

This commit is contained in:
gpt-engineer-app[bot]
2025-10-16 12:54:47 +00:00
parent e79eaf76ba
commit e340f1c489
5 changed files with 162 additions and 42 deletions

View File

@@ -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}