fix: 修复 Restaurant 类型转换的 TypeScript 编译错误

This commit is contained in:
2026-02-25 13:11:59 +08:00
parent 3b6910e6e8
commit 39213bb71e
+1 -1
View File
@@ -27,7 +27,7 @@ import type { UserProfile, UserPreferences, DecisionRecord, FavoriteRecord, Rest
function firstImage(r: Restaurant): string {
if (r.images?.length > 0) return r.images[0];
// backward compat: old DB records may have `image` instead of `images`
const legacy = (r as Record<string, unknown>).image;
const legacy = (r as unknown as Record<string, unknown>).image;
return typeof legacy === "string" ? legacy : "";
}