feat(modules): prefer API plan_code in toModuleIndexItem for dynamic deep-linking
This commit is contained in:
parent
e153668f06
commit
6291c325eb
|
|
@ -31,6 +31,7 @@ export interface ModuleResponse extends ModuleSummary {
|
|||
release_version: string | null;
|
||||
expected_release_date: string | null;
|
||||
release_notes: string | null;
|
||||
plan_code?: string | null;
|
||||
metadata: Record<string, unknown>;
|
||||
created_by: string | null;
|
||||
updated_by: string | null;
|
||||
|
|
|
|||
|
|
@ -224,6 +224,7 @@ export function toModuleIndexItem(module: ModuleResponse): ModuleIndexItem {
|
|||
const visual = MODULE_VISUALS[module.code.toLowerCase()];
|
||||
const metadataIcon = readMetadataString(module, "icon");
|
||||
const metadataColor = readMetadataString(module, "color");
|
||||
const apiPlanCode = asNonBlankString(module.plan_code);
|
||||
const metadataPlanCode = readMetadataString(module, "plan_code");
|
||||
const metadataIsDefaultFree = readMetadataBoolean(module, "is_default_free");
|
||||
|
||||
|
|
@ -241,7 +242,7 @@ export function toModuleIndexItem(module: ModuleResponse): ModuleIndexItem {
|
|||
icon: metadataIcon ?? visual?.icon ?? "folder-outline",
|
||||
color: metadataColor ?? visual?.color ?? "#4F46E5",
|
||||
isDefaultFree: metadataIsDefaultFree ?? visual?.isDefaultFree ?? false,
|
||||
planCode: metadataPlanCode ?? visual?.planCode ?? "",
|
||||
planCode: apiPlanCode ?? metadataPlanCode ?? visual?.planCode ?? "",
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue