Skip to content

Commit

Permalink
Make sightings on used for nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
adzialocha committed Jun 26, 2024
1 parent 58ddb0b commit c29a521
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/app/lib/models/used_for.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class UsedFor {
final DocumentId id;
DocumentViewId viewId;

DocumentId sighting;
DocumentId? sighting;
String usedFor;

UsedFor(
Expand All @@ -25,8 +25,9 @@ class UsedFor {
return UsedFor(
id: result['meta']['documentId'] as DocumentId,
viewId: result['meta']['viewId'] as DocumentViewId,
sighting:
result['fields']['sighting']['meta']['documentId'] as DocumentId,
sighting: result['fields']['sighting'] != null
? result['fields']['sighting']['meta']['documentId'] as DocumentId
: null,
usedFor: result['fields']['used_for'] as String);
}

Expand Down

0 comments on commit c29a521

Please sign in to comment.