mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-25 06:11:15 -05:00
Fix TypeScript strict mode errors
This commit is contained in:
@@ -47,7 +47,7 @@ const ParkOwners = () => {
|
||||
.from('parks')
|
||||
.select('property_owner_id')
|
||||
.not('property_owner_id', 'is', null)
|
||||
.then(({ data }) => data?.map(park => park.property_owner_id) || [])
|
||||
.then(({ data }) => data?.map(park => park.property_owner_id).filter((id): id is string => id !== null) || [])
|
||||
)
|
||||
.order('name');
|
||||
|
||||
@@ -68,7 +68,7 @@ const ParkOwners = () => {
|
||||
await submitCompanyCreation(
|
||||
data,
|
||||
'property_owner',
|
||||
user.id
|
||||
user!.id
|
||||
);
|
||||
|
||||
toast({
|
||||
@@ -95,7 +95,7 @@ const ParkOwners = () => {
|
||||
(owner.description && owner.description.toLowerCase().includes(searchTerm.toLowerCase()));
|
||||
|
||||
if (filterBy === 'all') return matchesSearch;
|
||||
if (filterBy === 'with-rating') return matchesSearch && owner.average_rating > 0;
|
||||
if (filterBy === 'with-rating') return matchesSearch && (owner.average_rating ?? 0) > 0;
|
||||
if (filterBy === 'established') return matchesSearch && owner.founded_year;
|
||||
|
||||
return matchesSearch;
|
||||
@@ -123,8 +123,8 @@ const ParkOwners = () => {
|
||||
useOpenGraph({
|
||||
title: 'Property Owners - ThrillWiki',
|
||||
description: `Browse ${filteredAndSortedOwners.length} theme park property owners worldwide`,
|
||||
imageUrl: filteredAndSortedOwners[0]?.banner_image_url,
|
||||
imageId: filteredAndSortedOwners[0]?.banner_image_id,
|
||||
imageUrl: filteredAndSortedOwners[0]?.banner_image_url ?? undefined,
|
||||
imageId: filteredAndSortedOwners[0]?.banner_image_id ?? undefined,
|
||||
type: 'website',
|
||||
enabled: !isLoading
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user