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