Open BinTofajjal opened 4 years ago
You need to filter first your categories before sending that data to the UI because a Category is not a String, it's an object. Here's a snippet that might work for you:
List<String> getCategoryListFriendlyName(List<Category> categories) { final List<String> temp = []; for(Category cat in categories) { temp.add(cat.name); } return temp; }
To get the author Avatar you might need to do another http request to fetch an user, there's a function inside of this library named fetchUser, use that. And inside of the parameters use the author id that is inside of the post.authorID to get the user with the avatar.
You can also add "?_embed" at the endpoint to embed more sibling metadata from other tables.
but it's not working.
Also, can I fetch the author's avatar too? If possible please let me know.