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() {
"url": url, Map<String, dynamic> ret = {
"title": title, "url": url,
"description": description, "title": title,
"is_archived": isArchived, "description": description,
"unread": unread, "is_archived": isArchived,
"shared": shared, "unread": unread,
"shared": shared,
};
if (tagNames != "") {
ret = {
...ret,
"tag_names": tagNames, "tag_names": tagNames,
}; };
}
return ret;
}
} }