Fix: getItemByTypeFromInsomniaCollection()

This commit is contained in:
Ashita Prasad
2025-02-24 12:34:15 +05:30
parent 0ee7bf6b5c
commit 91c761f5a9

View File

@@ -12,12 +12,12 @@ List<(String?, Resource)> getItemByTypeFromInsomniaCollection(
InsomniaCollection? ic,
String type,
) {
if (ic?.resources == null || ic!.resources!.length > 0) {
if (ic?.resources == null || ic!.resources!.length == 0) {
return [];
}
List<(String?, Resource)> requests = [];
for (var item in ic.resources!) {
if (item.type != null || item.type == type) {
if (item.type != null && item.type == type) {
requests.add((item.name, item));
}
}