Fix TypeScript strict mode errors

This commit is contained in:
gpt-engineer-app[bot]
2025-11-03 03:29:29 +00:00
parent 3c13b7a9f4
commit 288e87bcd3
11 changed files with 132 additions and 120 deletions

View File

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