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

@@ -411,7 +411,7 @@ export default function Profile() {
if (data) {
// Fetch location separately if location_id is visible
let locationData = null;
let locationData: any = null;
if (data.location_id) {
const { data: location } = await supabase
.from('locations')
@@ -426,7 +426,7 @@ export default function Profile() {
location: locationData
};
setProfile(profileWithLocation as ProfileType);
setProfile(profileWithLocation as unknown as ProfileType);
setEditForm({
username: data.username || '',
display_name: data.display_name || '',
@@ -436,8 +436,8 @@ export default function Profile() {
setAvatarImageId(data.avatar_image_id || '');
// Fetch calculated stats and recent activity for this user
await fetchCalculatedStats(data.user_id);
await fetchRecentActivity(data.user_id);
await fetchCalculatedStats(data.user_id || '');
await fetchRecentActivity(data.user_id || '');
}
} catch (error) {
console.error('Error fetching profile:', error);
@@ -772,7 +772,10 @@ export default function Profile() {
{/* Show location (privacy already enforced by get_filtered_profile) */}
<LocationDisplay
location={profile.location}
location={profile.location ? {
...profile.location,
city: profile.location.city ?? undefined
} : undefined}
/>
</div>
</div>}