+
"Checking eligibility..."
}
}>
@@ -125,64 +122,91 @@ pub fn StudentEligibilityPage() -> impl IntoView {
});
if valid {
debug_log!("Scholarship is valid.");
- Some(scholarship.clone())
+ let scholarship_id = StoredValue::new(scholarship.subject.clone());
+ let resource = Resource::new(
+ move || (
+ auth
+ .try_with(|a| a.authenticated().map(|a| a.access_token()))
+ .flatten(),
+ form_id.get_value(),
+ scholarship_id.get_value(),
+ ),
+ async move |(access_token, form_id, scholarship_id)| {
+ list_files(
+ access_token.unwrap_or_default(),
+ form_id,
+ scholarship_id,
+ )
+ .await
+ },
+ );
+ Some((scholarship.clone(), resource))
} else {
None
}
})
- .collect::
>();
-
- // Each scholarship will return Some(itself), or None. This is will be automatically
- // filtered based on the information. Invalid scholarships are None, along with those
- // that fail validation for any reason. Scholarships that are valid or did not choose
- // any requirements are Some(scholarship).
-
- // We want to cast to a list, and then map the list to a new
- // one that contains the correct ComparisonData.
+ .collect::<
+ Vec<(ExpandableInfo, Resource, ServerFnError>>)>,
+ >();
view! {
- {format!("Valid scholarships: {}", valid_list.len())}
-
- {scholarship_name}
-
- {scholarship_essay_prompt}
-
-
- }
- }
+