Fix add bookmark with no tags

This commit is contained in:
Juan Gilsanz Polo
2024-02-25 03:18:31 +01:00
parent 5b3b6fc109
commit 826ca58f85

View File

@@ -17,13 +17,21 @@ class PostBookmark {
required this.tagNames, required this.tagNames,
}); });
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() {
Map<String, dynamic> ret = {
"url": url, "url": url,
"title": title, "title": title,
"description": description, "description": description,
"is_archived": isArchived, "is_archived": isArchived,
"unread": unread, "unread": unread,
"shared": shared, "shared": shared,
};
if (tagNames != "") {
ret = {
...ret,
"tag_names": tagNames, "tag_names": tagNames,
}; };
} }
return ret;
}
}