Forum Discussion

frardouin's avatar
7 years ago

User profile page feed

Hello everyone, I'm trying to achieve something quite difficult for my current knowledge in lithium so a little help to build the rest query will by very appreciated. When visiting a user profile pa...
  • TariqHussain's avatar
    TariqHussain
    7 years ago

    frardouin- This is a bit tricky, you will need to make a nested call for this.

     

    1. The first call will fetch all the solved topics posted by an author

     

    SELECT * FROM messages WHERE depth = 0 AND conversation.solved = true AND author.id = '<authorID>'

    2. The second Call will fetch the accepted solution

     

    SELECT * FROM messages WHERE is_solution = true and topic.id = '<topid id you will get from first call>'

     

    Docoumentation: https://community.lithium.com/t5/Developer-Documentation/bd-p/dev-doc-portal?section=commv2&collection=messages#constraints-conversation.solved

     

    Regarding the re-ordering, if you want to show all the activities together, you need to sort it manually, you can not fetch all the details using on call. e.g store all the query result into on variable and then sort it by post_time.