chore: pass location image URL as topic image URL (#3876)
This commit is contained in:
parent
916da50bd4
commit
85ac0317b8
1 changed files with 9 additions and 3 deletions
|
|
@ -238,15 +238,17 @@ class CoursePlanModel {
|
|||
}
|
||||
|
||||
List<CmsCoursePlanTopicLocationMedia>? topicLocationMedias;
|
||||
if (cmsCoursePlanTopicLocationMedias != null) {
|
||||
if (cmsCoursePlanTopicLocationMedias != null &&
|
||||
topicLocations != null &&
|
||||
topicLocations.isNotEmpty) {
|
||||
final location = topicLocations.first;
|
||||
for (final media in cmsCoursePlanTopicLocationMedias) {
|
||||
if (media.coursePlanTopicLocations.contains(topic.id)) {
|
||||
if (media.coursePlanTopicLocations.contains(location.id)) {
|
||||
topicLocationMedias ??= [];
|
||||
topicLocationMedias.add(media);
|
||||
}
|
||||
}
|
||||
}
|
||||
// TODO: consume topicLocationMedias to form topic
|
||||
|
||||
topics ??= [];
|
||||
topics.add(
|
||||
|
|
@ -258,6 +260,10 @@ class CoursePlanModel {
|
|||
? topicLocations.first.name
|
||||
: "Any",
|
||||
activities: activityPlans,
|
||||
imageUrl:
|
||||
topicLocationMedias != null && topicLocationMedias.isNotEmpty
|
||||
? '${Environment.cmsApi}${topicLocationMedias.last.url}'
|
||||
: null,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue