mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 20:11:12 -05:00
Refactor: Fix type safety and auth
This commit is contained in:
@@ -98,12 +98,22 @@ export default function ManufacturerModels() {
|
||||
return;
|
||||
}
|
||||
|
||||
// For now, just show a toast since ride model submission isn't implemented yet
|
||||
toast({
|
||||
title: "Coming Soon",
|
||||
description: "Ride model submission is not yet available.",
|
||||
});
|
||||
return;
|
||||
if (!manufacturer) {
|
||||
toast({
|
||||
title: "Error",
|
||||
description: "Manufacturer information is missing.",
|
||||
variant: "destructive"
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const submissionData: RideModelSubmissionData = {
|
||||
...data,
|
||||
manufacturer_id: manufacturer.id,
|
||||
};
|
||||
|
||||
const { submitRideModelCreation } = await import('@/lib/entitySubmissionHelpers');
|
||||
await submitRideModelCreation(submissionData, user.id);
|
||||
|
||||
toast({
|
||||
title: "Ride Model Submitted",
|
||||
@@ -184,10 +194,12 @@ export default function ManufacturerModels() {
|
||||
<FerrisWheel className="w-8 h-8 text-primary" />
|
||||
<h1 className="text-4xl font-bold">Models by {manufacturer.name}</h1>
|
||||
</div>
|
||||
<Button onClick={() => setIsCreateModalOpen(true)}>
|
||||
<Plus className="w-4 h-4 mr-2" />
|
||||
Add Ride Model
|
||||
</Button>
|
||||
{user && (
|
||||
<Button onClick={() => setIsCreateModalOpen(true)}>
|
||||
<Plus className="w-4 h-4 mr-2" />
|
||||
Add Ride Model
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
<p className="text-lg text-muted-foreground mb-4">
|
||||
Explore all ride models manufactured by {manufacturer.name}
|
||||
|
||||
Reference in New Issue
Block a user