Fix merge errors

This commit is contained in:
Roland Geider
2023-03-20 14:19:29 +01:00
parent b60e19cb16
commit fa8dd7e46f
7 changed files with 328 additions and 310 deletions

View File

@@ -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);
}