mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
Fix merge errors
This commit is contained in:
@@ -90,9 +90,10 @@ class NutritionPlansProvider with ChangeNotifier {
|
||||
/// Fetches and sets all plans sparsely, i.e. only with the data on the plan
|
||||
/// object itself and no child attributes
|
||||
Future<void> fetchAndSetAllPlansSparse() async {
|
||||
final data = await fetch(makeUrl(_nutritionalPlansPath, query: {'limit': '1000'}));
|
||||
final data = await baseProvider
|
||||
.fetchPaginated(baseProvider.makeUrl(_nutritionalPlansPath, query: {'limit': '1000'}));
|
||||
_plans = [];
|
||||
for (final planData in data['results']) {
|
||||
for (final planData in data) {
|
||||
final plan = NutritionalPlan.fromJson(planData);
|
||||
_plans.add(plan);
|
||||
_plans.sort((a, b) => b.creationDate.compareTo(a.creationDate));
|
||||
@@ -128,7 +129,7 @@ class NutritionPlansProvider with ChangeNotifier {
|
||||
NutritionalPlan plan;
|
||||
try {
|
||||
plan = findById(planId);
|
||||
} on NoSuchEntryException catch (e) {
|
||||
} on NoSuchEntryException {
|
||||
plan = await fetchAndSetPlanSparse(planId);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user