Skip to content

Commit

Permalink
fix(database): safely type indexer fields and headers
Browse files Browse the repository at this point in the history
  • Loading branch information
JagandeepBrar committed Aug 17, 2022
1 parent 450be72 commit f1dcd0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/database/models/external_module.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ part 'external_module.g.dart';
@HiveType(typeId: 26, adapterName: 'LunaExternalModuleAdapter')
class LunaExternalModule extends HiveObject {
@JsonKey()
@HiveField(0)
@HiveField(0, defaultValue: '')
String displayName;

@JsonKey()
@HiveField(1)
@HiveField(1, defaultValue: '')
String host;

LunaExternalModule({
Expand Down
10 changes: 5 additions & 5 deletions lib/database/models/indexer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ part 'indexer.g.dart';
@HiveType(typeId: 1, adapterName: 'LunaIndexerAdapter')
class LunaIndexer extends HiveObject {
@JsonKey()
@HiveField(0)
@HiveField(0, defaultValue: '')
String displayName;

@JsonKey()
@HiveField(1)
@HiveField(1, defaultValue: '')
String host;

@JsonKey(name: 'key')
@HiveField(2)
@HiveField(2, defaultValue: '')
String apiKey;

@JsonKey()
@HiveField(3)
Map headers;
@HiveField(3, defaultValue: <String, String>{})
Map<String, String> headers;

@JsonKey()
@HiveField(4)
Expand Down

0 comments on commit f1dcd0c

Please sign in to comment.