From 5d4a64a23590b40c4f04103e9382e8b1935d3f4e Mon Sep 17 00:00:00 2001 From: Herwig Birke Date: Thu, 23 Oct 2025 16:12:40 +0200 Subject: [PATCH] Basis mit Image Gallery --- lib/features/igel/data/igel_images_repository.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/features/igel/data/igel_images_repository.dart b/lib/features/igel/data/igel_images_repository.dart index 0da3c65..6deba21 100644 --- a/lib/features/igel/data/igel_images_repository.dart +++ b/lib/features/igel/data/igel_images_repository.dart @@ -58,11 +58,13 @@ class IgelImagesRepository { throw ApiException(streamRes.statusCode, body); } final decoded = jsonDecode(body); - final uploaded = (decoded['uploaded'] as List).cast>(); + final list = (decoded is List) ? decoded : [decoded]; + final uploaded = list.cast>(); + return uploaded.map(IgelImage.fromMap).toList(); } Future delete(int imageId) async { - await api.delete('/igel/images/$imageId'); + await api.delete('/images/$imageId'); } }