Browse Source

[mob] sync person entity type

Neeraj Gupta 1 year ago
parent
commit
a75c440dc2
2 changed files with 6 additions and 0 deletions
  1. 5 0
      mobile/lib/models/api/entity/type.dart
  2. 1 0
      mobile/lib/services/entity_service.dart

+ 5 - 0
mobile/lib/models/api/entity/type.dart

@@ -2,6 +2,7 @@ import "package:flutter/foundation.dart";
 
 enum EntityType {
   location,
+  person,
   unknown,
 }
 
@@ -9,6 +10,8 @@ EntityType typeFromString(String type) {
   switch (type) {
     case "location":
       return EntityType.location;
+    case "person":
+      return EntityType.location;
   }
   debugPrint("unexpected collection type $type");
   return EntityType.unknown;
@@ -19,6 +22,8 @@ extension EntityTypeExtn on EntityType {
     switch (this) {
       case EntityType.location:
         return "location";
+      case EntityType.person:
+        return "person";
       case EntityType.unknown:
         return "unknown";
     }

+ 1 - 0
mobile/lib/services/entity_service.dart

@@ -87,6 +87,7 @@ class EntityService {
   Future<void> syncEntities() async {
     try {
       await _remoteToLocalSync(EntityType.location);
+      await _remoteToLocalSync(EntityType.person);
     } catch (e) {
       _logger.severe("Failed to sync entities", e);
     }