mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-11-26 22:14:56 +00:00
added validation
This commit is contained in:
@ -61,7 +61,6 @@ class SpaceTemplateModel {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class UpdateSubspaceTemplateModel {
|
||||
final String uuid;
|
||||
final Action action;
|
||||
@ -133,3 +132,28 @@ class UpdateTagModel {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
extension SpaceTemplateExtensions on SpaceTemplateModel {
|
||||
List<String> listAllTagValues() {
|
||||
final List<String> tagValues = [];
|
||||
|
||||
if (tags != null) {
|
||||
tagValues.addAll(
|
||||
tags!.map((tag) => tag.tag ?? '').where((tag) => tag.isNotEmpty));
|
||||
}
|
||||
|
||||
if (subspaceModels != null) {
|
||||
for (final subspace in subspaceModels!) {
|
||||
if (subspace.tags != null) {
|
||||
tagValues.addAll(
|
||||
subspace.tags!
|
||||
.map((tag) => tag.tag ?? '')
|
||||
.where((tag) => tag.isNotEmpty),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return tagValues;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user