[Vuejs]-Add users to projects they don't belong to? Postgres / Vue JS

0👍

Thanks for the tip. After playing around a bit with .filter on the frontend and some queries on the backend, I came to the conclusion that this will be easier to maintain:

SELECT id, email
FROM "user"
WHERE id NOT IN (SELECT user_id FROM userprojects WHERE project_id = 1)

I’ll replace the project_id = 1 with whatever project ID I’ll need to query for.

If this is considered a bad query, let me know.

-1👍

For things like this, you would generally filter your list on the frontend.
That way, you don’t need an addition API call on your backend and it’s just simpler/faster.

Leave a comment