Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

support read=false on paged contents query #103

Open
mydearxym opened this issue Dec 29, 2018 · 0 comments
Open

support read=false on paged contents query #103

mydearxym opened this issue Dec 29, 2018 · 0 comments

Comments

@mydearxym
Copy link
Member

when query read=true, i can use:

read == true ->
   queryable
   |> join(:inner, [content, f, c], viewers in assoc(content, :viewers))
   |> where([content, f, c, viewers], viewers.user_id == ^user.id)

but came to read=false, this is not work as except

read == true ->
   queryable
   |> join(:inner, [content, f, c], viewers in assoc(content, :viewers))
   |> where([content, f, c, viewers], viewers.user_id != ^user.id)

because the viewers assoc only have records of viewed user, the unviewed user is not in that table
left_join is not working either, need help...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant