1
0
mirror of https://github.com/go-vikunja/app synced 2024-06-07 13:09:51 +00:00

made owner nullable to fix Favourites list

This commit is contained in:
Benimautner 2022-09-27 17:54:02 +02:00
parent 57b219836f
commit d6fb2e3b79

View File

@ -4,7 +4,7 @@ class Namespace {
final int id; final int id;
final DateTime created, updated; final DateTime created, updated;
final String title, description; final String title, description;
final User owner; final User? owner;
Namespace({ Namespace({
this.id = 0, this.id = 0,
@ -22,14 +22,14 @@ class Namespace {
id = json['id'], id = json['id'],
created = DateTime.parse(json['created']), created = DateTime.parse(json['created']),
updated = DateTime.parse(json['updated']), updated = DateTime.parse(json['updated']),
owner = User.fromJson(json['owner']); owner = json['owner'] != null ? User.fromJson(json['owner']) : null;
Map<String, dynamic> toJSON() => { Map<String, dynamic> toJSON() => {
'id': id, 'id': id,
'created': created.toUtc().toIso8601String(), 'created': created.toUtc().toIso8601String(),
'updated': updated.toUtc().toIso8601String(), 'updated': updated.toUtc().toIso8601String(),
'title': title, 'title': title,
'owner': owner.toJSON(), 'owner': owner?.toJSON(),
'description': description 'description': description
}; };