Basis mit Image Gallery
This commit is contained in:
@@ -58,11 +58,13 @@ class IgelImagesRepository {
|
||||
throw ApiException(streamRes.statusCode, body);
|
||||
}
|
||||
final decoded = jsonDecode(body);
|
||||
final uploaded = (decoded['uploaded'] as List).cast<Map<String, dynamic>>();
|
||||
final list = (decoded is List) ? decoded : [decoded];
|
||||
final uploaded = list.cast<Map<String, dynamic>>();
|
||||
|
||||
return uploaded.map(IgelImage.fromMap).toList();
|
||||
}
|
||||
|
||||
Future<void> delete(int imageId) async {
|
||||
await api.delete<dynamic>('/igel/images/$imageId');
|
||||
await api.delete<dynamic>('/images/$imageId');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user