Think I'm ready to host this one!

This commit is contained in:
2025-09-04 20:08:38 -05:00
parent 399ce36981
commit 64a05df71d
3 changed files with 77 additions and 62 deletions

View File

@@ -14,23 +14,23 @@ type RWCtx = MutationCtx | QueryCtx;
type StatusRow = {
user: {
id: Id<'users'>,
name: string | null,
imageId: Id<'_storage'> | null,
imageUrl: string | null,
}
id: Id<'users'>;
name: string | null;
imageId: Id<'_storage'> | null;
imageUrl: string | null;
};
latest: {
id: Id<'statuses'>,
message: string,
updatedAt: number,
updatedBy: Id<'users'>,
} | null,
id: Id<'statuses'>;
message: string;
updatedAt: number;
updatedBy: Id<'users'>;
} | null;
updatedByUser: {
id: Id<'users'>,
name: string | null,
imageId: Id<'_storage'> | null,
imageUrl: string | null,
} | null,
id: Id<'users'>;
name: string | null;
imageId: Id<'_storage'> | null;
imageUrl: string | null;
} | null;
};
// CHANGED: typed helpers
@@ -159,8 +159,7 @@ const getName = (u: Doc<'users'>): string | null =>
const getImageId = (u: Doc<'users'>): Id<'_storage'> | null => {
if (!('image' in u)) return null;
const img =
(u as { image?: unknown }).image as string | undefined;
const img = (u as { image?: unknown }).image as string | undefined;
return img && img.length > 0 ? (img as Id<'_storage'>) : null;
};