Think I'm ready to host this one!
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user